Ignore:
Timestamp:
Feb 18, 2009, 2:44:41 PM (15 years ago)
Author:
rwilson
Message:

Ongoing conversion changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/geospatial_data/test_geospatial_data.py

    r6304 r6360  
    18361836
    18371837################################################################################
    1838 # Test the clean_line() utility function.
    1839 ################################################################################
    1840 
    1841     # helper routine to test clean_line()
    1842     def clean_line_test(self, instr, delim, expected):
    1843         result = clean_line(instr, delim)
    1844         self.failUnless(result == expected,
    1845                         "clean_line('%s', '%s'), expected %s, got %s"
    1846                         % (str(instr), str(delim), str(expected), str(result)))
    1847 
    1848     def test_clean_line_01(self):
    1849         self.clean_line_test('abc, ,,xyz,123', ',', ['abc', '', 'xyz', '123'])
    1850 
    1851     def test_clean_line_02(self):
    1852         self.clean_line_test(' abc , ,, xyz  , 123  ', ',',
    1853                              ['abc', '', 'xyz', '123'])
    1854 
    1855     def test_clean_line_03(self):
    1856         self.clean_line_test('1||||2', '|', ['1', '2'])
    1857 
    1858     def test_clean_line_04(self):
    1859         self.clean_line_test('abc, ,,xyz,123, ', ',',
    1860                              ['abc', '', 'xyz', '123', ''])
    1861 
    1862     def test_clean_line_05(self):
    1863         self.clean_line_test('abc, ,,xyz,123, ,    ', ',',
    1864                             ['abc', '', 'xyz', '123', '', ''])
    1865 
    1866     def test_clean_line_06(self):
    1867         self.clean_line_test(',,abc, ,,xyz,123, ,    ', ',',
    1868                             ['abc', '', 'xyz', '123', '', ''])
    1869 
    1870     def test_clean_line_07(self):
    1871         self.clean_line_test('|1||||2', '|', ['1', '2'])
    1872 
    1873     def test_clean_line_08(self):
    1874         self.clean_line_test(' ,a,, , ,b,c , ,, , ', ',',
    1875                              ['', 'a', '', '', 'b', 'c', '', '', ''])
    1876 
    1877     def test_clean_line_09(self):
    1878         self.clean_line_test('a:b:c', ':', ['a', 'b', 'c'])
    1879 
    1880     def test_clean_line_10(self):
    1881         self.clean_line_test('a:b:c:', ':', ['a', 'b', 'c'])
    1882 
    1883     # new version of function should leave last field if contains '\n'.
    1884     # cf. test_clean_line_10() above.
    1885     def test_clean_line_11(self):
    1886         self.clean_line_test('a:b:c:\n', ':', ['a', 'b', 'c', ''])
    18871838
    18881839if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.