def test_function_as_instance_attribute(self):
    obj = SomeClass()

    def f(a):
        pass
    obj.f = f
    mock = create_autospec(obj)
    mock.f('bing')
    mock.f.assert_called_with('bing')
def test_function_as_instance_attribute(self):
    obj = SomeClass()

    def f(a):
        pass
    obj.f = f
    mock = create_autospec(obj)
    mock.f('bing')
    mock.f.assert_called_with('bing')