Beispiel #1
0
 def issue(self, user_login, repo_name, number):
     try:
         user = self.users[user_login]
         repo = user.repositories[repo_name]
         return repo.issues[int(number)]
     except KeyError:
         return null.NullObject('Issue')
Beispiel #2
0
 def license(self, license):
     if license == 'valid_license':
         template = mock.Mock()
         template.body = 'template'
         return template
     else:
         return null.NullObject('License')
Beispiel #3
0
 def create_issue(self, user_login, repo_name, issue_title, issue_desc):
     try:
         user = self.users[user_login]
         repo = user.repositories[repo_name]
         issue = repo.create_issue(issue_title, issue_desc)
         return issue
     except KeyError:
         return null.NullObject('Issue')
Beispiel #4
0
 def user(self, user_id):
     try:
         return self.users[user_id]
     except KeyError:
         return null.NullObject('User')