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")
def test_nop_visit(self): obj = Base(None, None) obj.not_called = Mock() obj.visit("missing_method") obj.not_called.assert_not_called()