def test_other_branch(self): "Run the GitClone command for another branch." command = GitClone(self.repository_url, branch='other', use_cache=False) command.run(self.context) # check version info results_info = command.get_results() pprint.pprint(results_info) # debugging output assert results_info['version_info'] == """\ 7f8a8e130a3cc631752e275ea57220a1b6e2dddb look ma, another branch\\!""" assert results_info['version_type'] == 'git' # check files cwd = os.getcwd() os.chdir(self.context.tempdir) try: assert os.path.exists(os.path.join('pony-build-git-test', 'test1')) assert not os.path.exists(os.path.join('pony-build-git-test', 'test2')) assert os.path.exists(os.path.join('pony-build-git-test', 'test3')) finally: os.chdir(cwd)
def test_basic(self): "Run the GitClone command w/o caching and verify it." command = GitClone(self.repository_url, use_cache=False) command.run(self.context) # check version info results_info = command.get_results() pprint.pprint(results_info) # debugging output assert results_info['version_info'] == """\ c57591d8cc9ef3c293a2006416a0bb8b2ffed26d secondary commit""" assert results_info['version_type'] == 'git' # check files os.chdir(self.context.tempdir) assert os.path.exists(os.path.join('pony-build-git-test', 'test1')) assert os.path.exists(os.path.join('pony-build-git-test', 'test2'))
def test_basic(self): "Run the GitClone command and verify that it produces an updated repo." command = GitClone(self.repository_url) command.run(self.context) results_info = command.get_results() pprint.pprint(results_info) # debugging output assert results_info['version_info'] == """\ c57591d8cc9ef3c293a2006416a0bb8b2ffed26d secondary commit""" assert results_info['version_type'] == 'git' cwd = os.getcwd() os.chdir(self.context.tempdir) try: assert os.path.exists(os.path.join('pony-build-git-test', 'test1')) assert os.path.exists(os.path.join('pony-build-git-test', 'test2')) finally: os.chdir(cwd)