def test_api_no_credentials(self): self.assertRaises(tfl.TflError, lambda: tfl.Api())
def test_api_credentials(self): api = tfl.Api(app_id="test", app_key="test") self.assertTrue(all([api.app_id, api.app_key])) self.assertEqual(self.base_url, api.base_url)
def setUp(self): self.app_id = os.environ.get("APP_ID") self.app_key = os.environ.get("APP_KEY") self.base_url = "https://api.tfl.gov.uk/" self.api = tfl.Api(app_id=self.app_id, app_key=self.app_key)
def test_journey_mode(self): api = tfl.Api(app_id=self.app_id, app_key=self.app_key) modes = api.GetJourneyModes() self.assertGreater(len(modes), 0) self.assertTrue(isinstance(modes[0], tfl.JourneyMode))
def setUp(self): self.app_id = os.environ.get("APP_ID") self.app_key = os.environ.get("APP_KEY") self.api = tfl.Api(app_id=self.app_id, app_key=self.app_key)