本文整理汇总了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)
示例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()