Example #1
0
 def test_row_has_must_have_metrics_non_existant_metric(self):
     csvlines = FittingUtilTestCase.csv_content.splitlines()
     dictreader = csv.DictReader(csvlines)
     metrics = ['xxx']
     for d in dictreader:
         with self.assertRaises(KeyError):
             f_util.row_has_must_have_metrics(d, metrics)
Example #2
0
 def test_row_has_must_have_metrics_bad_data(self):
     csvlines = FittingUtilTestCase.csv_content.splitlines()
     dictreader = csv.DictReader(csvlines)
     metrics = ['tss']
     row_tests = []
     for d in dictreader:
         row_tests.append(f_util.row_has_must_have_metrics(d, metrics))
     self.assertFalse(all(row_tests))
Example #3
0
 def test_row_has_must_have_metrics2(self):
     csvlines = FittingUtilTestCase.csv_content3.splitlines()
     dictreader = csv.DictReader(csvlines)
     metrics = ['60m_critical_power', 'tss']
     row_tests = []
     for d in dictreader:
         row_tests.append(f_util.row_has_must_have_metrics(d, metrics))
     self.assertTrue(row_tests.count(True) == 6)
     self.assertTrue(row_tests.count(False) == 2)
Example #4
0
 def test_row_has_must_have_metrics(self):
     csvlines = FittingUtilTestCase.csv_content.splitlines()
     metrics = ['60m_critical_power', 'skiba_bike_score']
     dictreader = csv.DictReader(csvlines)
     for d in dictreader:
         self.assertTrue(f_util.row_has_must_have_metrics(d, metrics))