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()
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))
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))