Пример #1
0
    def test_get_issue(self):
        p1 = ProjectIssue.add('test1', 'test1 description', 'test', project=1,
                              assignee='assignee')
        p1.close('test')
        p2 = ProjectIssue.add('test2', 'test2 description', 'test', project=1,
                              assignee='assignee')
        p2.close('test')
        p3 = ProjectIssue.add('test3', 'test3 description', 'test', project=1,
                              assignee='assignee')
        p4 = ProjectIssue.add('test4', 'test4 description', 'test', project=1,
                              assignee='test')
        p5 = ProjectIssue.add('test5', 'test5 description', 'test1', project=2,
                              assignee='test')

        rs = UserIssue.gets_by_creator_id('test', state='open')
        assert all([isinstance(i, ProjectIssue) for i in rs])
        assert len(rs) == 2

        rs = UserIssue.gets_by_assignee_id('test', state='open')
        assert all([isinstance(i, ProjectIssue) for i in rs])
        assert len(rs) == 2
Пример #2
0
    def test_get_issue(self):
        p1 = ProjectIssue.add('test1',
                              'test1 description',
                              'test',
                              project=1,
                              assignee='assignee')
        p1.close('test')
        p2 = ProjectIssue.add('test2',
                              'test2 description',
                              'test',
                              project=1,
                              assignee='assignee')
        p2.close('test')
        p3 = ProjectIssue.add('test3',
                              'test3 description',
                              'test',
                              project=1,
                              assignee='assignee')
        p4 = ProjectIssue.add('test4',
                              'test4 description',
                              'test',
                              project=1,
                              assignee='test')
        p5 = ProjectIssue.add('test5',
                              'test5 description',
                              'test1',
                              project=2,
                              assignee='test')

        rs = UserIssue.gets_by_creator_id('test', state='open')
        assert all([isinstance(i, ProjectIssue) for i in rs])
        assert len(rs) == 2

        rs = UserIssue.gets_by_assignee_id('test', state='open')
        assert all([isinstance(i, ProjectIssue) for i in rs])
        assert len(rs) == 2
Пример #3
0
 def get_count_assigned_issues(self, state):
     return len(UserIssue.gets_by_assignee_id(self.name, state))
Пример #4
0
 def get_assigned_issues(self, state, limit=25, start=0):
     issues = UserIssue.gets_by_assignee_id(self.name, state)
     issues.sort(key=lambda x: x.updated_at, reverse=True)
     return issues[start:start + limit]
Пример #5
0
 def get_count_created_issues(self, state):
     return len(UserIssue.gets_by_creator_id(self.name, state))
Пример #6
0
 def get_repos_issues(self, state):
     return UserIssue.gets_by_creator_id(self.name, state)
Пример #7
0
 def get_n_participated_issues(self, state='open'):
     issues = UserIssue.get_participated_issues(self.username, state)
     return len(issues)
Пример #8
0
 def get_participated_issues(self, state='open', limit=25, start=0):
     issues = UserIssue.get_participated_issues(self.username, state)
     issues.sort(key=lambda x: x.updated_at, reverse=True)
     return issues[start:start + limit]
Пример #9
0
 def get_count_assigned_issues(self, state):
     return len(UserIssue.gets_by_assignee_id(self.name, state))
Пример #10
0
 def get_assigned_issues(self, state, limit=25, start=0):
     issues = UserIssue.gets_by_assignee_id(self.name, state)
     issues.sort(key=lambda x: x.updated_at, reverse=True)
     return issues[start:start + limit]
Пример #11
0
 def get_count_created_issues(self, state):
     return len(UserIssue.gets_by_creator_id(self.name, state))
Пример #12
0
 def get_repos_issues(self, state):
     return UserIssue.gets_by_creator_id(self.name, state)
Пример #13
0
 def get_n_participated_issues(self, state='open'):
     issues = UserIssue.get_participated_issues(self.username, state)
     return len(issues)
Пример #14
0
 def get_participated_issues(self, state='open', limit=25, start=0):
     issues = UserIssue.get_participated_issues(self.username, state)
     issues.sort(key=lambda x: x.updated_at, reverse=True)
     return issues[start:start + limit]
Пример #15
0
 def issues(self, request):
     state = request.get_form_var('state', 'open')
     owner_id = self.user.name
     issues = UserIssue.gets_by_creator_id(owner_id, state=state)
     return [i.as_dict() for i in issues if i.target_type == 'project']
Пример #16
0
 def issues(self, request):
     state = request.get_form_var('state', 'open')
     owner_id = self.user.name
     issues = UserIssue.gets_by_creator_id(owner_id, state=state)
     return [i.as_dict() for i in issues if i.target_type == 'project']