Skip to content

Commit

Permalink
Add osm2cityflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
only-changer committed Oct 23, 2019
1 parent 5bf2601 commit 4563e69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/python/test_osm_converter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import os
import json
from tools.converter.osm2cityflow import extract, draw


Expand All @@ -11,6 +12,11 @@ class TestOsmConverter(unittest.TestCase):
def test_converter(self):
nodes = extract(osmFile=self.osmFile)
draw(nodes, self.CityFlowFile, True)
with open(self.CityFlowFile, 'r') as f:
roadnet = json.load(f)
intersectionsNum = len(roadnet["intersections"])
roadsNum = len(roadnet["roads"])
self.assertTrue(intersectionsNum <= roadsNum)


if __name__ == '__main__':
Expand Down

0 comments on commit 4563e69

Please sign in to comment.