當前位置: 首頁>>代碼示例>>Python>>正文


Python Issue.get方法代碼示例

本文整理匯總了Python中vilya.models.issue.Issue.get方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.get方法的具體用法?Python Issue.get怎麽用?Python Issue.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vilya.models.issue.Issue的用法示例。


在下文中一共展示了Issue.get方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_issue

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [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

示例2: get_by_issue_id

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [as 別名]
 def get_by_issue_id(cls, issue_id):
     issue = Issue.get(issue_id)
     if issue:
         from vilya.models.fair import FAIR_ID
         return cls(id, FAIR_ID, issue.id, issue.id, issue.title,
                    issue.creator_id, issue.assignee_id, issue.closer_id,
                    issue.created_at, issue.updated_at, issue.closed_at,
                    issue.type)
開發者ID:000fan000,項目名稱:code,代碼行數:10,代碼來源:fair_issue.py

示例3: test_close_issue

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [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

示例4: test_update_issue

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [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

示例5: get_by_issue_id

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [as 別名]
 def get_by_issue_id(cls, issue_id):
     sql = ("select id, team_id, issue_id, number from team_issues "
            "where issue_id = %s ")
     rs = store.execute(sql, (issue_id,))
     if rs and rs[0]:
         id, team_id, issue_id, number = rs[0]
         issue = Issue.get(issue_id)
         if issue:
             return cls(id, team_id, issue.id, number, issue.title,
                        issue.creator_id, issue.assignee_id,
                        issue.closer_id, issue.created_at, issue.updated_at,
                        issue.closed_at, issue.type)
開發者ID:leeccong,項目名稱:code,代碼行數:14,代碼來源:team_issue.py

示例6: delete_issue

# 需要導入模塊: from vilya.models.issue import Issue [as 別名]
# 或者: from vilya.models.issue.Issue import get [as 別名]
 def delete_issue(self):
     issue = Issue.get(self.issue_id)
     issue.delete()
開發者ID:000fan000,項目名稱:code,代碼行數:5,代碼來源:project_issue.py


注:本文中的vilya.models.issue.Issue.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。