Exemple #1
0
 def test_register_metric(self):
     from sourced.ml.core.algorithms.id_splitter.nn_model import register_metric, METRICS
     fake_metric = "fake metric"
     register_metric(fake_metric)
     self.assertIn(fake_metric, METRICS)
     METRICS.pop()
     self.assertNotIn(fake_metric, METRICS)
Exemple #2
0
 def test_raise_register_metric(self):
     from sourced.ml.core.algorithms.id_splitter.nn_model import register_metric, METRICS
     bad_metric = 1
     with self.assertRaises(AssertionError):
         register_metric(bad_metric)
     self.assertNotIn(bad_metric, METRICS)