Skip to content

Commit a9de225

Browse files
committed
Added unit test for clean function
1 parent 1569d9b commit a9de225

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_osm_graph.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ def test_to_geojson_with_points_and_osm_id(self):
256256
nodes_data = json.load(f)
257257
self.assertEqual(len(nodes_data['features']), 0)
258258

259+
def test_clean(self):
260+
osm_graph = OSMGraph.from_geojson(self.nodes_geojson, self.edges_geojson)
261+
self.assertEqual(len(osm_graph.G.nodes), 3)
262+
osm_graph.clean()
263+
self.assertFalse(hasattr(osm_graph, 'G'))
264+
259265

260266
if __name__ == '__main__':
261267
unittest.main()

0 commit comments

Comments
 (0)