def setUp(self): odx = ODX(0, 1) odx.load_gtsf() day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M") megas = odx.preprocess_gtsf(day) builder = NetworkBuilder(700) self.net = builder.build(megas, 1)
def test_get_megas_stops(self): odx = ODX(0, 1) odx.load_gtsf() day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M") megas = odx.preprocess_gtsf(day) plotter = PlotStops() for stop in megas['51']: plotter.add_mega( stop) # for s in stop.stops: # plotter.add_stop(s) for stop in megas['RAIL']: plotter.add_mega(stop) plotter.export('test.html')
class TestODX(unittest.TestCase): def setUp(self): self.odx = ODX(0, 1) self.odx.load_gtsf() self.day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M") def test_odx_preprocess_gtsf(self): self.assertEqual(type(self.odx.preprocess_gtsf(self.day)), dict, "GTSF MegaStops incorrect type") i, j = list(self.odx.megas.items())[1] self.assertEqual(type(i), str, "Route is incorrect Type") self.assertEqual(type(j), list, 'Mega Stop collection mapped to incorrect type') self.assertEqual(type(j[0]), MegaStop, "Megas does not have mega stops in it") i, j = list(self.odx.megas.items())[0] self.assertEqual(type(j), list, 'Mega Stop collection mapped to incorrect type') self.assertEqual(type(j[0]), MegaStop, "Megas does not have mega stops in it") def test_odx_build_network(self): pass
def test_build_ball_tree(self): odx = ODX(0, 1) odx.load_gtsf() day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M") odx.preprocess_gtsf(day) fac = MegaStopFac(700)
def setUp(self): odx = ODX(0, 1) odx.load_gtsf() day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M") self.megas = odx.preprocess_gtsf(day)