def setUp(self): # create validator object using textfiles test_feed_dir = os.path.join(os.path.dirname(__file__), "test_data/") test_feed_b_dir = os.path.join(test_feed_dir, "feed_b") self.gtfs_source_dir = os.path.join(os.path.dirname(__file__), "test_data") self.G_txt = GTFS.from_directory_as_inmemory_db( [test_feed_dir, test_feed_b_dir]) self.import_validator = ImportValidator( [test_feed_dir, test_feed_b_dir], self.G_txt, verbose=False)
def test_get_trips(): gtfs_source_dir = os.path.join(os.path.dirname(__file__), "test_data") gtfs = GTFS.from_directory_as_inmemory_db(gtfs_source_dir) first_day_start_ut, last_day_start_ut = gtfs.get_day_start_ut_span() stop_1_info = gtfs.stop(1) lat = stop_1_info.get("lat") lon = stop_1_info.get("lon") spreader = Spreader(gtfs, first_day_start_ut + 8 * 3600, lat, lon, 24 * 3600, 30, True, 0.5) trips = spreader.spread() assert isinstance(trips, dict) assert "trips" in trips assert len(trips["trips"]) > 0 el = trips["trips"][0] keys = "lats lons times route_type name".split() for key in keys: assert key in el, el
def setUpClass(cls): """ This method is run once before executing any tests""" cls.gtfs_source_dir = os.path.join(os.path.dirname(__file__), "test_data") cls.G = GTFS.from_directory_as_inmemory_db(cls.gtfs_source_dir)
def setUp(self): """This method is run once before _each_ test method is executed""" self.gtfs = GTFS.from_directory_as_inmemory_db(self.gtfs_source_dir) self.RMM = RouteMapMaker(self.gtfs)
def setUpClass(cls): """ This method is run once before executing any tests""" cls.gtfs_source_dir = "../../../../gtfspy/gtfspy/test/test_data" cls.G = GTFS.from_directory_as_inmemory_db(cls.gtfs_source_dir)
def setUp(self): self.gtfs_source_dir = os.path.join(os.path.dirname(__file__), "test_data") self.G = GTFS.from_directory_as_inmemory_db(self.gtfs_source_dir)