Example #1
0
    def test_visit(self):
        obj = Base(None, None)
        obj.called = Mock()

        obj.visit("called", "with", keyword="args")

        obj.called.assert_called_once_with("with", keyword="args")
Example #2
0
    def test_nop_visit(self):
        obj = Base(None, None)
        obj.not_called = Mock()

        obj.visit("missing_method")

        obj.not_called.assert_not_called()