示例#1
0
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
示例#2
0
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
示例#3
0
def test_encode():
    assert encode(7, -1632, 9851) == "RU6063103"
示例#4
0
def test_encode():
    assert encode(7, -1632, 9851) == "RU6063103"