def test_repo_commits(): """ Test the repo_commits function """ instance = Plugin() status = instance.repo_commits('https://github.com/cyberreboot/vent') assert type(status) == tuple assert status[0] == True assert type(status[1]) == list
def test_repo_commits(): """ Test the repo_commits function """ instance = Plugin() status = instance.add('https://github.com/cyberreboot/vent', build=False) assert isinstance(status, tuple) assert status[0] == True instance = MenuHelper() status = instance.repo_commits('https://github.com/cyberreboot/vent') assert isinstance(status, tuple)
def repo_values(self): """ Set the appropriate repo dir and get the branches and commits of it """ branches = [] commits = {} plugin = Plugin() status = plugin.repo_branches(self.parentApp.repo_value['repo']) # branches and commits must both be retrieved successfully if status[0]: branches = status[1] status = plugin.repo_commits(self.parentApp.repo_value['repo']) if status[0]: r_commits = status[1] for commit in r_commits: commits[commit[0]] = commit[1] else: # if commits failed, return commit errors return status else: # if branch failed, return branch errors return status # if everything is good, return branches with commits return branches, commits