def test_create_autospec_return_value(self):

    def f():
        pass
    mock = create_autospec(f, return_value='foo')
    self.assertEqual(mock(), 'foo')

    class Foo(object):
        pass
    mock = create_autospec(Foo, return_value='foo')
    self.assertEqual(mock(), 'foo')
def test_create_autospec_return_value(self):

    def f():
        pass
    mock = create_autospec(f, return_value='foo')
    self.assertEqual(mock(), 'foo')

    class Foo(object):
        pass
    mock = create_autospec(Foo, return_value='foo')
    self.assertEqual(mock(), 'foo')