def test_spec_as_list(self):
    mock = create_autospec([])
    mock.append('foo')
    mock.append.assert_called_with('foo')
    self.assertRaises(AttributeError, getattr, mock, 'foo')

    class Foo(object):
        foo = []
    mock = create_autospec(Foo)
    mock.foo.append(3)
    mock.foo.append.assert_called_with(3)
    self.assertRaises(AttributeError, getattr, mock.foo, 'foo')
def test_spec_as_list(self):
    mock = create_autospec([])
    mock.append('foo')
    mock.append.assert_called_with('foo')
    self.assertRaises(AttributeError, getattr, mock, 'foo')

    class Foo(object):
        foo = []
    mock = create_autospec(Foo)
    mock.foo.append(3)
    mock.foo.append.assert_called_with(3)
    self.assertRaises(AttributeError, getattr, mock.foo, 'foo')