Exemple #1
0
 def test_output_schema(self):
     result = pull_data(self.polling_locations, self.election)
     self.assertIn('dates', result)
     self.assertIn('by_polling_center', result)
     self.assertIn('by_country', result)
     self.assertIn('by_office', result)
     self.assertIn('offices', result)
     self.assertIn('by_region', result)
Exemple #2
0
 def test_output_schema(self):
     result = pull_data(self.polling_locations, self.election)
     self.assertIn('dates', result)
     self.assertIn('by_polling_center', result)
     self.assertIn('by_country', result)
     self.assertIn('by_office', result)
     self.assertIn('offices', result)
     self.assertIn('by_region', result)
Exemple #3
0
 def test_last_updated(self):
     result = pull_data(self.polling_locations, self.election)
     last_updated = datetime.datetime.strptime(result['last_updated'],
                                               '%Y-%m-%dT%X.%f')
     # last updated is what we expect (within a minute)
     self.assertTrue(
         (last_updated -
          datetime.datetime.now()) < datetime.timedelta(minutes=1))
Exemple #4
0
 def test_last_updated(self):
     result = pull_data(self.polling_locations, self.election)
     last_updated = datetime.datetime.strptime(result['last_updated'], '%Y-%m-%dT%X.%f')
     # last updated is what we expect (within a minute)
     self.assertTrue((last_updated - datetime.datetime.now()) < datetime.timedelta(minutes=1))