Пример #1
0
def test_lat_lon_float_iterator():
    # Demonstrates use of an alternate function to open the file while reusing the iterators as-is.
    with urllib.request.urlopen('file:' + os.getcwd() + '/work_with_collections/locations.xml') as source:
        rows = tuple(lat_lon_float_iterator(latitude_longitude_iterator(xml_tree_to_row_iterator(source))))
        assert(len(rows) == 6)
        assert(len(rows[0]) == 2)
Пример #2
0
def test_xml_tree_to_row_iterator():
    with open(os.getcwd() + '/work_with_collections/locations.xml') as source:
        rows = tuple(xml_tree_to_row_iterator(source))
        assert(len(rows) == 6)
        assert(len(rows[0]) == 3)