Пример #1
0
 def test_one_measurement(self):
     """Test that the end timestamp of the measurement is returned."""
     now = datetime.now().isoformat()
     report = dict(subjects=dict(subject1=dict(metrics=dict(metric1=dict(
         recent_measurements=[dict(end=now)])))))
     json_data = dict(reports=[report])
     self.assertEqual(now, most_recent_measurement_timestamp(json_data))
Пример #2
0
 def test_no_measurements(self):
     """Test without measurements."""
     report = dict(subjects=dict(subject1=dict(metrics=dict(metric1=dict(
         recent_measurements=[])))))
     json_data = dict(reports=[report])
     self.assertEqual(datetime.min.isoformat(),
                      most_recent_measurement_timestamp(json_data))