def test_bad_url_insert_traffic_data(self):
     tmp_url = self.app.config['NYC_LINK_SPEED_URL']
     self.app.config['NYC_LINK_SPEED_URL'] = ""
     self.assertEqual(insert_traffic_data(), 500)
     self.app.config['NYC_LINK_SPEED_URL'] = tmp_url
 def test_insert_traffic_data(self):
      self.assertTrue(insert_traffic_data())
Пример #3
0
def init_scheduler():
    data_ingestion.insert_traffic_data()
    apsched = Scheduler()
    apsched.start()
    # Retrieve traffic data every 5 min
    apsched.add_interval_job(lambda: data_ingestion.insert_traffic_data(), seconds=300)