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


Python Changeset.has_full_dependency_info方法代碼示例

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


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

示例1: test_has_needed_dependencies

# 需要導入模塊: from majormajor.changeset import Changeset [as 別名]
# 或者: from majormajor.changeset.Changeset import has_full_dependency_info [as 別名]
    def test_has_needed_dependencies(self):
        doc = self.doc0

        cs1 = Changeset(doc.get_id(), 'user', [doc.get_root_changeset()])
        assert doc.has_needed_dependencies(cs1)

        cs2 = Changeset(doc.get_id(), 'user', [cs1])
        assert not doc.has_needed_dependencies(cs2)

        doc.receive_changeset(cs1)
        assert doc.has_needed_dependencies(cs2)

        cs3 = Changeset(doc.get_id(), 'user', [cs1, cs2])
        assert not doc.has_needed_dependencies(cs3)

        doc.receive_changeset(cs2)
        assert doc.has_needed_dependencies(cs3)

        cs4 = Changeset(doc.get_id(), 'user', [cs3, "555"])
        assert not doc.has_needed_dependencies(cs4)

        doc.receive_changeset(cs3)
        assert not doc.has_needed_dependencies(cs4)

        cs5 = Changeset(doc.get_id(), 'user', [cs1])
        cs5.set_id("555")
        doc.receive_changeset(cs5)
        cs4.relink_changesets(doc.all_known_changesets)
        assert cs5 in cs4.get_parents()
        assert cs4.has_full_dependency_info()
        assert doc.has_needed_dependencies(cs4)
開發者ID:citizencurator,項目名稱:majormajor,代碼行數:33,代碼來源:test_document_helpers.py

示例2: test_has_full_dependency_info

# 需要導入模塊: from majormajor.changeset import Changeset [as 別名]
# 或者: from majormajor.changeset.Changeset import has_full_dependency_info [as 別名]
    def test_has_full_dependency_info(self):
        # should always pass when it has no dependencies
        cs0 = Changeset('doc_id', 'user_id', [])
        assert cs0.has_full_dependency_info()

        cs1 = Changeset('doc_id', 'user_id', ['randomid'])
        assert not cs1.has_full_dependency_info()

        cs2 = Changeset('doc_id', 'user_id', [cs1])
        assert cs2.has_full_dependency_info()

        cs3 = Changeset('doc_id', 'user_id', [cs2, 'otherrandomid'])
        assert not cs3.has_full_dependency_info()

        cs4 = Changeset('doc_id', 'user_id', [cs1])
        cs5 = Changeset('doc_id', 'user_id', [cs4, cs3])
        assert cs5.has_full_dependency_info()

        cs6 = Changeset('doc_id', 'user_id', [cs5, 'otherid'])
        assert not cs6.has_full_dependency_info()
開發者ID:citizencurator,項目名稱:majormajor,代碼行數:22,代碼來源:test_changeset_helpers.py


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