def test_train(self): root = Metric('test') root.train = Mock() leaf = Metric('test') leaf.train = Mock() tree = MetricTree(root) tree.add_child(leaf) tree.train() root.train.assert_called_once() leaf.train.assert_called_once()
def test_train(self): root = Metric('test') root.train = Mock() leaf = Metric('test') leaf.train = Mock() tree = MetricTree(root) tree.add_child(leaf) tree.train() self.assertEqual(root.train.call_count, 1) self.assertEqual(leaf.train.call_count, 1)
def test_train(self): my_mock = Metric('test') my_mock.train = Mock(return_value=None) metric = MetricList([my_mock]) metric.train() my_mock.train.assert_called_once()
def test_train(self): my_mock = Metric('test') my_mock.train = Mock(return_value=None) metric = MetricList([my_mock]) metric.train() self.assertEqual(my_mock.train.call_count, 1)