Fix up some failing tests
This commit is contained in:
parent
28505a5d8d
commit
f201deabbc
@ -121,12 +121,12 @@ class UnicodeTest(unittest.TestCase):
|
|||||||
self.cli = CLIDbManager(DbState())
|
self.cli = CLIDbManager(DbState())
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
# for (dirpath, dirnames, filenames) in os.walk(self.newpath, False):
|
for (dirpath, dirnames, filenames) in os.walk(self.newpath, False):
|
||||||
# for afile in filenames:
|
for afile in filenames:
|
||||||
# os.remove(os.path.join(dirpath, afile))
|
os.remove(os.path.join(dirpath, afile))
|
||||||
# for adir in dirnames:
|
for adir in dirnames:
|
||||||
# os.rmdir(os.path.join(dirpath, adir))
|
os.rmdir(os.path.join(dirpath, adir))
|
||||||
# os.rmdir(self.newpath)
|
os.rmdir(self.newpath)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Test that clidbman will open files in a path containing
|
# Test that clidbman will open files in a path containing
|
||||||
|
@ -42,7 +42,7 @@ class GrampsDbBaseTest(unittest.TestCase):
|
|||||||
|
|
||||||
self._db = DbBsddb()
|
self._db = DbBsddb()
|
||||||
dbman = CLIDbManager(None)
|
dbman = CLIDbManager(None)
|
||||||
self._filename, title = dbman.create_new_db_cli(title="Test")
|
self._filename, title = dbman.create_new_db_cli(title=u"Test")
|
||||||
self._db.load(self._filename, dummy_callback, "w")
|
self._db.load(self._filename, dummy_callback, "w")
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -86,7 +86,7 @@ class PlaceTest(unittest.TestCase):
|
|||||||
self._test_formats_fail(lat, lon)
|
self._test_formats_fail(lat, lon)
|
||||||
|
|
||||||
def test_dm_ds(self):
|
def test_dm_ds(self):
|
||||||
lat, lon = ' 50°59.60"N', ' 2°53\'E'
|
lat, lon = ' 50°59.60\'N', ' 2°53\'E'
|
||||||
self._test_formats_success(lat, lon)
|
self._test_formats_success(lat, lon)
|
||||||
|
|
||||||
def test_both_in_latitude(self):
|
def test_both_in_latitude(self):
|
||||||
@ -109,7 +109,7 @@ class PlaceTest(unittest.TestCase):
|
|||||||
self._test_formats_fail(lat, lon)
|
self._test_formats_fail(lat, lon)
|
||||||
|
|
||||||
def test_precision(self):
|
def test_precision(self):
|
||||||
lat, lon = ' 50°59.99"S', ' 2°59\'59.99"E'
|
lat, lon = ' 50°59\'59.99"S', ' 2°59\'59.99"E'
|
||||||
self._test_formats_success(lat, lon)
|
self._test_formats_success(lat, lon)
|
||||||
|
|
||||||
lat, lon = 'N50.849888888888', 'E2.885897222222'
|
lat, lon = 'N50.849888888888', 'E2.885897222222'
|
||||||
@ -151,7 +151,7 @@ class PlaceTest(unittest.TestCase):
|
|||||||
self._test_formats_fail(lat, lon)
|
self._test_formats_fail(lat, lon)
|
||||||
|
|
||||||
lat, lon = ' 89°40\'00"N', ' 2°53.1\'W'
|
lat, lon = ' 89°40\'00"N', ' 2°53.1\'W'
|
||||||
self._test_formats_fail(lat, lon)
|
self._test_formats_success(lat, lon)
|
||||||
|
|
||||||
lat, lon = '+61° 43\' 60.00"', '+17° 7\' 60.00"'
|
lat, lon = '+61° 43\' 60.00"', '+17° 7\' 60.00"'
|
||||||
self._test_formats_fail(lat, lon)
|
self._test_formats_fail(lat, lon)
|
||||||
@ -165,7 +165,7 @@ class PlaceTest(unittest.TestCase):
|
|||||||
self._test_formats_success(lat, lon)
|
self._test_formats_success(lat, lon)
|
||||||
|
|
||||||
def test_roundoff(self):
|
def test_roundoff(self):
|
||||||
lat, lon = ' 1°59.999"N', ' 1°59.999"E'
|
lat, lon = ' 1°59.999\'N', ' 1°59.999\'E'
|
||||||
self._test_formats_success(lat, lon)
|
self._test_formats_success(lat, lon)
|
||||||
|
|
||||||
lat, lon = ' 1°59\'59.9999"N', ' 1°59\'59.9999"E'
|
lat, lon = ' 1°59\'59.9999"N', ' 1°59\'59.9999"E'
|
||||||
@ -295,3 +295,6 @@ def conv_SWED_RT90_WGS84(X, Y):
|
|||||||
LAT = math.degrees(LAT)
|
LAT = math.degrees(LAT)
|
||||||
LON = math.degrees(LON)
|
LON = math.degrees(LON)
|
||||||
return LAT, LON
|
return LAT, LON
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user