def test_download_lstree_git(self):
git_url = 'git://githoobie.com/lol.git<%s>' % tree_object
await self._do_download(git_url)
# ensure git config was appended to, and that the output file was
# opened
self.open.assert_any_call('/t/mut/lol.git/config', 'a')
self.open.assert_any_call('/t/res/lol.git', 'w+')
# ensure the sequence of git commands were called
assert self.subprocess.run.mock_calls == [
call(['git', 'clone', '--bare',
'git://githoobie.com/lol.git', '/t/mut/lol.git']),
call(['git', 'ls-tree', '-r', '--long', '--full-tree',
tree_object],
cwd='/t/mut/lol.git', stdout=self.open()),
]
评论列表
文章目录