Hi,
I'm trying to mock a call to git.Repo(path).remotes.origin.pull(). Here's one of my many attempts:
self.mox.StubOutWithMock(git, 'Repo')
repo = git.Repo(IgnoreArg())
repo_remotes = self.mox.CreateMockAnything()
repo_remotes_origin = self.mox.CreateMockAnything()
repo.remotes.AndReturn(repo_remotes)
repo_remotes.origin.AndReturn(repo_remotes_origin)
repo_remotes_origin.pull().AndReturn(True)
self.mox.ReplayAll()
The error I see is:
"AttributeError: MockMethod has no attribute "remotes". Did you remember to put your mocks in replay mode?"
Can anybody provide some guidance? I'm new to object mocking frameworks.
Thanks,
Jason