def test_total(): testcasefile = open("./geohex/tests/testcase.list", "r") for line in testcasefile: lat, lon, level, hexcode = line.rstrip("\n\r").split(",") hex_x, hex_y = deg2hex(int(level), float(lon), float(lat)) resultcode = encode(int(level), hex_x, hex_y) print(resultcode + ":" + hexcode) print(hexcode) assert resultcode == hexcode
def test_encode(): assert encode(7, -1632, 9851) == "RU6063103"