def test_to_dict_metric_factory(self, build_mock):
     metric = metrics.MetricFactory
     build_mock.return_value = metrics.Metric('test')
     out = metrics.to_dict(metric)().build()
     self.assertTrue(out.metric.name == 'test')
     self.assertTrue(isinstance(out, metrics.ToDict))
     build_mock.assert_called_once()
示例#2
0
 def test_to_dict_metric_instance(self):
     metric = metrics.Metric('test')
     out = metrics.to_dict(metric)
     self.assertTrue(out.metric.name == 'test')
     self.assertTrue(isinstance(out, metrics.ToDict))
示例#3
0
 def test_to_dict_metric(self):
     metric = metrics.Metric
     out = metrics.to_dict(metric)('test').build()
     self.assertTrue(out.metric.name == 'test')
     self.assertTrue(isinstance(out, metrics.ToDict))