本文整理汇总了Python中manifest.Manifest.diff方法的典型用法代码示例。如果您正苦于以下问题:Python Manifest.diff方法的具体用法?Python Manifest.diff怎么用?Python Manifest.diff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manifest.Manifest
的用法示例。
在下文中一共展示了Manifest.diff方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_diff_two_files_vs_file_and_empty_subdir
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_two_files_vs_file_and_empty_subdir(self):
m1 = Manifest_from_walking_unpacked_tar("two_files.tar")
m2 = Manifest_from_walking_unpacked_tar("file_and_empty_subdir.tar")
self.assertEqual(list(Manifest.diff(m1, m2)), [
("bar", None), (None, "file"), ("foo", None), (None, "subdir")])
self.assertEqual(list(Manifest.diff(m2, m1)), [
(None, "bar"), ("file", None), (None, "foo"), ("subdir", None)])
示例2: test_min_max_diff_with_diff_at_muliples_levels
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_min_max_diff_with_diff_at_muliples_levels(self):
m1 = ManifestFileParser().build("""\
1foo
2bar
1xyzzy
1blah
2zyxxy
3diff
3baz
""".split("\n"))
m2 = ManifestFileParser().build("""\
1foo
2bar
1xyzzy
1blah
2diff
2zyxxy
3baz
4diff
1diff
""".split("\n"))
self.assertEqual(list(Manifest.diff(m1, m2)), [
(None, "2bar/1xyzzy/2diff"),
("2bar/3diff", None),
(None, "4diff"),
])
self.assertEqual(list(Manifest.diff(m1, m2, recursive = True)), [
(None, "2bar/1xyzzy/2diff"),
("2bar/3diff", None),
(None, "4diff"),
(None, "4diff/1diff"),
])
示例3: test_diff_like
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_like(self):
for t in TEST_TARS:
m1 = Manifest_from_walking_unpacked_tar(t)
m2 = Manifest_from_walking_unpacked_tar(t)
self.assertEqual(list(Manifest.diff(m1, m2)), [])
self.assertEqual(list(Manifest.diff(m2, m1)), [])
self.assertEqual(m1, m2)
self.assertEqual(m2, m1)
示例4: test_diff_unlike
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_unlike(self):
shifted = TEST_TARS[:]
shifted.append(shifted.pop(0))
for t1, t2 in zip(TEST_TARS, shifted):
m1 = Manifest_from_walking_unpacked_tar(t1)
m2 = Manifest_from_walking_unpacked_tar(t2)
self.assertTrue(list(Manifest.diff(m1, m2)))
self.assertTrue(list(Manifest.diff(m2, m1)))
self.assertNotEqual(m1, m2)
self.assertNotEqual(m2, m1)
self.assertEqual(len(list(Manifest.diff(m1, m2))),
len(list(Manifest.diff(m2, m1))))
示例5: test_max_diff_two_files_vs_files_at_many_levels
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_max_diff_two_files_vs_files_at_many_levels(self):
m1 = Manifest_from_walking_unpacked_tar("two_files.tar")
m2 = Manifest_from_walking_unpacked_tar("files_at_many_levels.tar")
self.assertEqual(list(Manifest.diff(m1, m2, recursive = True)), [
(None, "baz"), (None, "baz/bar"), (None, "baz/baz"),
(None, "baz/baz/bar"), (None, "baz/baz/baz"), (None, "baz/baz/foo"),
(None, "baz/foo")])
示例6: test_diff_empties
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_empties(self):
m1 = Manifest()
m2 = ManifestFileParser().build([""])
m3 = Manifest_from_walking_unpacked_tar("empty.tar")
self.assertEqual(list(Manifest.diff(m1, m2)), [])
self.assertEqual(list(Manifest.diff(m1, m3)), [])
self.assertEqual(list(Manifest.diff(m2, m1)), [])
self.assertEqual(list(Manifest.diff(m2, m3)), [])
self.assertEqual(list(Manifest.diff(m3, m1)), [])
self.assertEqual(list(Manifest.diff(m3, m2)), [])
self.assertEqual(m1, m2)
self.assertEqual(m2, m3)
self.assertEqual(m3, m1)
示例7: test_min_diff_two_files_vs_files_at_many_levels
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_min_diff_two_files_vs_files_at_many_levels(self):
m1 = Manifest_from_walking_unpacked_tar("two_files.tar")
m2 = Manifest_from_walking_unpacked_tar("files_at_many_levels.tar")
self.assertEqual(list(Manifest.diff(m1, m2)), [(None, "baz")])
示例8: test_diff_single_file_vs_two_files
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_single_file_vs_two_files(self):
m1 = Manifest_from_walking_unpacked_tar("single_file.tar")
m2 = Manifest_from_walking_unpacked_tar("two_files.tar")
self.assertEqual(list(Manifest.diff(m1, m2)), [(None, "bar")])
self.assertEqual(list(Manifest.diff(m2, m1)), [("bar", None)])
示例9: test_diff_empty_vs_single_file
# 需要导入模块: from manifest import Manifest [as 别名]
# 或者: from manifest.Manifest import diff [as 别名]
def test_diff_empty_vs_single_file(self):
m1 = Manifest_from_walking_unpacked_tar("empty.tar")
m2 = Manifest_from_walking_unpacked_tar("single_file.tar")
self.assertEqual(list(Manifest.diff(m1, m2)), [(None, "foo")])
self.assertEqual(list(Manifest.diff(m2, m1)), [("foo", None)])