示例#1
0
def test5():
    from formatlib import formatter
    with open('data_samples/test5.json', 'r') as json_file:
        formatter = formatter.Formatter(json_file)

    formatter.convert_utm("UTM_1")
    res = formatter.convert_utm("UTM_2")
    assert res[format_key("UTM_1")]["latitude"] == 32.096175 and res[format_key("UTM_1")]["longitude"] == 34.805204 \
        and res[format_key("UTM_2")]["latitude"] == 32.015281 and res[format_key("UTM_2")]["longitude"] == 34.748833
示例#2
0
def test7():
    from benedict import benedict
    from formatlib import formatter
    with open('data_samples/test7.json', 'r') as json_file:
        formatter = formatter.Formatter(json_file)

    formatter.convert_utm("geometry.coordinates")
    res = benedict(formatter.convert_utm("a.b.c.loc"))
    assert res[format_key("geometry.coordinates")]["latitude"] == 32.096175 \
           and res[format_key("geometry.coordinates")]["longitude"] == 34.805204 \
           and res[format_key("a.b.c.loc")]["latitude"] == 32.015281 \
           and res[format_key("a.b.c.loc")]["longitude"] == 34.748833