本文整理汇总了Python中dulwich.pack.Pack.name方法的典型用法代码示例。如果您正苦于以下问题:Python Pack.name方法的具体用法?Python Pack.name怎么用?Python Pack.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dulwich.pack.Pack
的用法示例。
在下文中一共展示了Pack.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_copy
# 需要导入模块: from dulwich.pack import Pack [as 别名]
# 或者: from dulwich.pack.Pack import name [as 别名]
def test_copy(self):
origpack = self.get_pack(pack1_sha)
try:
self.assertSucceeds(origpack.index.check)
basename = os.path.join(self.tempdir, 'Elch')
write_pack(basename, [(x, '') for x in origpack.iterobjects()],
len(origpack))
newpack = Pack(basename)
try:
self.assertEquals(origpack, newpack)
self.assertSucceeds(newpack.index.check)
self.assertEquals(origpack.name(), newpack.name())
self.assertEquals(origpack.index.get_pack_checksum(),
newpack.index.get_pack_checksum())
wrong_version = origpack.index.version != newpack.index.version
orig_checksum = origpack.index.get_stored_checksum()
new_checksum = newpack.index.get_stored_checksum()
self.assertTrue(wrong_version or orig_checksum == new_checksum)
finally:
newpack.close()
finally:
origpack.close()
示例2: test_copy
# 需要导入模块: from dulwich.pack import Pack [as 别名]
# 或者: from dulwich.pack.Pack import name [as 别名]
def test_copy(self):
origpack = self.get_pack(pack1_sha)
self.assertEquals(True, origpack.idx.check())
write_pack("Elch", [(x, "") for x in origpack.iterobjects()], len(origpack))
newpack = Pack("Elch")
self.assertEquals(origpack, newpack)
self.assertEquals(True, newpack.idx.check())
self.assertEquals(origpack.name(), newpack.name())
self.assertEquals(origpack.idx.get_pack_checksum(), newpack.idx.get_pack_checksum())
self.assertTrue(
(origpack.idx.version != newpack.idx.version)
or (origpack.idx.get_stored_checksum() == newpack.idx.get_stored_checksum())
)