当前位置: 首页>>代码示例>>Python>>正文


Python Issue.add方法代码示例

本文整理汇总了Python中vilya.models.issue.Issue.add方法的典型用法代码示例。如果您正苦于以下问题:Python Issue.add方法的具体用法?Python Issue.add怎么用?Python Issue.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vilya.models.issue.Issue的用法示例。


在下文中一共展示了Issue.add方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_issue_stat

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
    def test_issue_stat(self):
        issue_rs = get_all_issue()
        assert len(issue_rs) == 0
        issue_open_count = len(filter(lambda x: x[1] is None, issue_rs))
        assert issue_open_count == 0
        assert len(issue_rs) - issue_open_count == 0

        i1 = Issue.add('test1', 'test des1', 'testuser1', 'assignee')
        issue_rs = get_all_issue()
        assert len(issue_rs) == 1
        issue_open_count = len(filter(lambda x: x[1] is None, issue_rs))
        assert issue_open_count == 1
        assert len(issue_rs) - issue_open_count == 0

        i2 = Issue.add('test2', 'test des1', 'testuser1', 'assignee')
        i3 = Issue.add('test3', 'test des1', 'testuser2', 'assignee')
        issue_rs = get_all_issue()
        assert len(issue_rs) == 3
        issue_open_count = len(filter(lambda x: x[1] is None, issue_rs))
        assert issue_open_count == 3
        assert len(issue_rs) - issue_open_count == 0

        i1.close('testuser1')
        issue_rs = get_all_issue()
        assert len(issue_rs) == 3
        issue_open_count = len(filter(lambda x: x[1] is None, issue_rs))
        assert issue_open_count == 2
        assert len(issue_rs) - issue_open_count == 1

        issue_comment_count = get_issue_comment_count()
        assert issue_comment_count == 0
        IssueComment.add(i2.id, 'content', 'test')
        IssueComment.add(i3.id, 'content', 'test1')
        issue_comment_count = get_issue_comment_count()
        assert issue_comment_count == 2
开发者ID:leeccong,项目名称:code,代码行数:37,代码来源:test_stat.py

示例2: test_get_issue

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
    def test_get_issue(self):

        issue1 = Issue.add('test1', 'test1 description', 'test', 'assignee')
        issue2 = Issue.add('test2', 'test2 description', 'test', 'assignee')
        issue2.close("test")

        i1 = Issue.get(issue1.id)
        assert isinstance(i1, Issue)
        assert i1.title == 'test1'
        assert i1.description == 'test1 description'
        assert i1.creator_id == 'test'
        assert i1.assignee_id == 'assignee'
        assert i1.closer_id is None

        i2 = Issue.get(issue2.id)
        assert isinstance(i2, Issue)
        assert i2.title == 'test2'
        assert i2.description == 'test2 description'
        assert i2.creator_id == 'test'
        assert i2.assignee_id == 'assignee'
        assert i2.closer_id == 'test'

        i1 = Issue.get(issue1.id)
        assert isinstance(i1, Issue)
        assert i1.title == 'test1'
        assert i1.description == 'test1 description'
        assert i1.creator_id == 'test'
        assert i1.assignee_id == 'assignee'
        assert i1.closer_id is None

        iss = Issue.gets_by_creator_id("test")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 4

        iss = Issue.gets_by_creator_id("test", "open")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 4

        iss = Issue.gets_by_creator_id("test", "closed")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 2

        iss = Issue.gets_by_assignee_id("assignee")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 6

        iss = Issue.gets_by_assignee_id("assignee", "open")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 4

        iss = Issue.gets_by_assignee_id("assignee", "closed")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 2

        iss = Issue.gets_by_closer_id("test")
        assert all([isinstance(i, Issue) for i in iss])
        assert len(iss) == 2
开发者ID:000fan000,项目名称:code,代码行数:59,代码来源:test_issue.py

示例3: test_add_comment

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def test_add_comment(self):
     i = Issue.add('test', 'test description', 'test', 'assignee')
     c = IssueComment.add(i.id, 'content', 'test')
     assert isinstance(c, IssueComment)
     assert c.issue_id == i.id
     assert c.content == 'content'
     assert c.author_id == 'test'
开发者ID:000fan000,项目名称:code,代码行数:9,代码来源:test_issue.py

示例4: test_add_issue

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def test_add_issue(self):
     i = Issue.add('test', 'test description', 'test', 'assignee')
     assert isinstance(i, Issue)
     assert i.title == 'test'
     assert i.description == 'test description'
     assert i.creator_id == 'test'
     assert i.assignee_id == 'assignee'
开发者ID:000fan000,项目名称:code,代码行数:9,代码来源:test_issue.py

示例5: add

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def add(
     cls,
     title,
     description,
     creator,
     number=None,
     team=None,
     project=None,
     assignee=None,
     closer=None,
     created_at=None,
     updated_at=None,
     closed_at=None,
 ):
     issue = Issue.add(
         title, description, creator, assignee=assignee, closer=closer, type=cls.target_type, target_id=project
     )
     if issue and project:
         number = PICounter.incr(project, number)
         store.execute(
             "insert into project_issues (project_id, issue_id, number) " "values (%s, %s, %s) ",
             (project, issue.id, number),
         )
         store.commit()
         mc.delete(MC_KEY_PROJECT_ISSUE_CREATOR_N % (project, creator, "open"))
         mc.delete(MC_KEY_PROJECT_ISSUE_CREATOR_N % (project, creator, "closed"))
         cls._clean_cache(project)
         return Issue.get_cached_issue(issue.id)
开发者ID:mozillazg,项目名称:code,代码行数:30,代码来源:project_issue.py

示例6: test_update_comment

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def test_update_comment(self):
     i = Issue.add('test', 'test description', 'test', 'assignee')
     c = IssueComment.add(i.id, 'content', 'test')
     c.update('content1')
     c = IssueComment.get(c.id)
     assert c.issue_id == i.id
     assert c.content == 'content1'
     assert c.author_id == 'test'
开发者ID:000fan000,项目名称:code,代码行数:10,代码来源:test_issue.py

示例7: test_close_issue

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def test_close_issue(self):
     i = Issue.add('test', 'test description', 'test', 'assignee')
     i.close("test")
     i = Issue.get(i.id)
     assert i.title == 'test'
     assert i.description == 'test description'
     assert i.creator_id == 'test'
     assert i.closer_id == "test"
     assert i.assignee_id == 'assignee'
开发者ID:000fan000,项目名称:code,代码行数:11,代码来源:test_issue.py

示例8: test_update_issue

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def test_update_issue(self):
     i = Issue.add('test', 'test description', 'test', 'assignee')
     i.update("test1", "test1 description")
     i = Issue.get(i.id)
     assert i.title == 'test1'
     assert i.description == 'test1 description'
     assert i.creator_id == 'test'
     assert i.assignee_id == 'assignee'
     assert i.closer_id is None
开发者ID:000fan000,项目名称:code,代码行数:11,代码来源:test_issue.py

示例9: test_get_comment

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
    def test_get_comment(self):
        i = Issue.add('test', 'test description', 'test', 'assignee')
        c = IssueComment.add(i.id, 'content', 'test')
        c = IssueComment.get(c.id)
        assert isinstance(c, IssueComment)
        assert c.issue_id == i.id
        assert c.content == 'content'
        assert c.author_id == 'test'

        c = IssueComment.add(i.id, 'content', 'test')
        cs = IssueComment.gets_by_issue_id(i.id)
        assert all([isinstance(t, IssueComment) for t in cs])
        assert len(cs) == 2
开发者ID:000fan000,项目名称:code,代码行数:15,代码来源:test_issue.py

示例10: add

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def add(cls, title, description, creator, number=None,
         team=None, project=None, assignee=None, closer=None,
         created_at=None, updated_at=None, closed_at=None):
     issue = Issue.add(title, description, creator, assignee=assignee,
                       closer=closer, type=cls.target_type, target_id=team)
     if issue and team:
         number = TICounter.incr(team, number)
         team_issue_id = store.execute(
             'insert into team_issues (team_id, issue_id, number) '
             'values (%s, %s, %s)',
             (team, issue.id, number))
         store.commit()
         return cls(team_issue_id, team, issue.id, number, title, creator,
                    assignee, closer, issue.created_at, issue.updated_at)
开发者ID:leeccong,项目名称:code,代码行数:16,代码来源:team_issue.py

示例11: add

# 需要导入模块: from vilya.models.issue import Issue [as 别名]
# 或者: from vilya.models.issue.Issue import add [as 别名]
 def add(cls, title, description, creator, number=None,
         team=None, project=None, assignee=None, closer=None,
         created_at=None, updated_at=None, closed_at=None):
     issue = Issue.add(title, description, creator, assignee=assignee,
                       closer=closer, type='fair', target_id=team)
     if issue:
         number = issue.id
         '''
         team_issue_id = store.execute(
             'insert into team_issues (team_id, issue_id, number) '
             'values (%s, %s, %s)',
             (team, issue.id, number))
         store.commit()
         '''
         return cls(issue.id, team, issue.id, number, title, creator,
                    assignee, closer, issue.created_at, issue.updated_at)
开发者ID:000fan000,项目名称:code,代码行数:18,代码来源:fair_issue.py


注:本文中的vilya.models.issue.Issue.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。