def test_get_coord_three(self): geod = Geodetic() z = 21 x = 599187 y = 749974 lon, lat = geod.get_coord(z, x, y) lon = geod.truncate(lon) lat = geod.truncate(lat) assert float(lon) == -77.1427345 and \ float(lat) == 38.7415695
def test_get_coord_four(self): geod = Geodetic() z = 21 x = 599188 y = 749975 lon, lat = geod.get_coord(z, x, y) lon = geod.truncate(lon) lat = geod.truncate(lat) assert float(lon) == -77.1425628 and \ float(lat) == 38.7417411
def test_tile_to_lat_lon_two(self): z = 0 x = y = 1 lat, lon = ScaledWorldMercator.tile_to_lat_lon(z, x, y) lat_result = Geodetic.truncate(lat) assert float(lat_result) == 85.0840590 and \ lon == 180.0
def test_truncate(self): x = 12.34567890 result = Geodetic.truncate(x) assert float(result) == 12.3456789
def test_invert_y_two(self): z = y = 0 assert Geodetic.invert_y(z, y) == 0
def test_invert_y_one(self): z = 2 y = 0 assert Geodetic.invert_y(z, y) == 1
def test_get_coord_two(self): geod = Geodetic() z = x = y = 1 lon, lat = geod.get_coord(z, x, y) assert lon == 0.0 and lat == 90.0
def test_get_coord_one(self): geod = Geodetic() z = 1 x = y = 0 lon, lat = geod.get_coord(z, x, y) assert lon == -180.0 and lat == -90.0
def test_pixel_size(self): geod = Geodetic() z = randint(0, 21) result = geod.pixel_size(z) assert 2**z * result == geod.resolution_factor
def test_res_fact(self): geod = Geodetic() assert geod.resolution_factor == 360.0 / geod.tile_size
def test_tile_size(self): geod = Geodetic() assert geod.tile_size == 256