예제 #1
0
 def repo_values(self):
     """
     Set the appropriate repo dir and get the branches and commits of it
     """
     branches = []
     commits = {}
     m_helper = MenuHelper()
     status = m_helper.repo_branches(self.parentApp.repo_value['repo'])
     # branches and commits must both be retrieved successfully
     if status[0]:
         branches = status[1]
         status = m_helper.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
예제 #2
0
def test_repo_branches():
    """ Test the repo_branches function """
    instance = MenuHelper()
    status = instance.repo_branches('https://github.com/cyberreboot/vent')
    assert isinstance(status, tuple)
    assert status[0] == True