当前位置: 首页>>代码示例>>Python>>正文


Python Manifest.diff方法代码示例

本文整理汇总了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)])
开发者ID:jherland,项目名称:manifest,代码行数:9,代码来源:test_Manifest_merge_diff.py

示例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"),
     ])
开发者ID:jherland,项目名称:manifest,代码行数:34,代码来源:test_Manifest_merge_diff.py

示例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)
开发者ID:jherland,项目名称:manifest,代码行数:10,代码来源:test_Manifest_merge_diff.py

示例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))))
开发者ID:jherland,项目名称:manifest,代码行数:15,代码来源:test_Manifest_merge_diff.py

示例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")])
开发者ID:jherland,项目名称:manifest,代码行数:9,代码来源:test_Manifest_merge_diff.py

示例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)
开发者ID:jherland,项目名称:manifest,代码行数:15,代码来源:test_Manifest_merge_diff.py

示例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")])
开发者ID:jherland,项目名称:manifest,代码行数:6,代码来源:test_Manifest_merge_diff.py

示例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)])
开发者ID:jherland,项目名称:manifest,代码行数:7,代码来源:test_Manifest_merge_diff.py

示例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)])
开发者ID:jherland,项目名称:manifest,代码行数:7,代码来源:test_Manifest_merge_diff.py


注:本文中的manifest.Manifest.diff方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。