示例#1
0
文件: tests.py 项目: rich-pixley/rcmp
    def testDirDirect(self):
        itestdir = rcmp.Items.find_or_create(self.emptydirname, rcmp.root)
        itestdir2 = rcmp.Items.find_or_create(self.dirnotemptybase, rcmp.root)

        ## DirComparator no longer instantiates so we don't have any
        ## easy way to stub out lower level comparators just now.

        # assert_equal(rcmp.Comparison(litem=itestdir, ritem=itestdir, comparators=[
        #     rcmp.DirComparator([]),
        #     ], exit_asap=self.exit_asap).cmp(), rcmp.Same)

        # assert_equal(rcmp.ComparisonList([[self.emptydirname], [self.emptydirname]], comparators=[
        #     rcmp.DirComparator([]),
        #     ], exit_asap=self.exit_asap).cmp(), rcmp.Same)

        assert_equal(
            rcmp.Comparison(litem=itestdir,
                            ritem=itestdir,
                            comparators=[
                                rcmp.DirComparator,
                            ],
                            exit_asap=self.exit_asap).cmp(), rcmp.Same)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.emptydirname]],
                                comparators=[
                                    rcmp.DirComparator,
                                ],
                                exit_asap=self.exit_asap).cmp(), rcmp.Same)

        assert_equal(
            rcmp.Comparison(litem=itestdir,
                            ritem=itestdir2,
                            comparators=[
                                rcmp.DirComparator,
                            ],
                            exit_asap=self.exit_asap).cmp(), rcmp.Different)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.dirnotemptybase]],
                                comparators=[
                                    rcmp.DirComparator,
                                ],
                                exit_asap=self.exit_asap).cmp(),
            rcmp.Different)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.dirnotemptybase]],
                                comparators=[
                                    rcmp.DirComparator,
                                ],
                                ignores=rcmp.fntore(['*' + self.foilername]),
                                exit_asap=self.exit_asap).cmp(), rcmp.Same)
示例#2
0
    def testDirDirect(self):
        itestdir = rcmp.Items.find_or_create(self.emptydirname)
        itestdir2 = rcmp.Items.find_or_create(self.dirnotemptybase)

        assert_equal(
            rcmp.Comparison(litem=itestdir,
                            ritem=itestdir,
                            comparators=[
                                rcmp.DirComparator([]),
                            ]).cmp(), rcmp.Same)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.emptydirname]],
                                comparators=[
                                    rcmp.DirComparator([]),
                                ]).cmp(), rcmp.Same)

        assert_equal(
            rcmp.Comparison(litem=itestdir,
                            ritem=itestdir,
                            comparators=[
                                rcmp.DirComparator(),
                            ]).cmp(), rcmp.Same)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.emptydirname]],
                                comparators=[
                                    rcmp.DirComparator(),
                                ]).cmp(), rcmp.Same)

        assert_equal(
            rcmp.Comparison(litem=itestdir,
                            ritem=itestdir2,
                            comparators=[
                                rcmp.DirComparator(),
                            ]).cmp(), rcmp.Different)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.dirnotemptybase]],
                                comparators=[
                                    rcmp.DirComparator(),
                                ]).cmp(), rcmp.Different)

        assert_equal(
            rcmp.ComparisonList([[self.emptydirname], [self.dirnotemptybase]],
                                comparators=[
                                    rcmp.DirComparator(),
                                ],
                                ignores=['*' + self.foilername]).cmp(),
            rcmp.Same)
示例#3
0
 def testBitwiseIndeterminateList(self):
     assert_equal(
         rcmp.ComparisonList(
             [[self.testfilenames[0]], [self.testfilenames[1]]],
             comparators=[
                 rcmp.BitwiseComparator(),
             ]).cmp(), False)
示例#4
0
 def testBitwiseList(self):
     assert_equal(
         rcmp.ComparisonList(
             [[self.testfilenames[0]], [self.testfilenames[0]]],
             comparators=[
                 rcmp.BitwiseComparator(),
             ]).cmp(), rcmp.Same)
示例#5
0
文件: tests.py 项目: rich-pixley/rcmp
 def testInodeIndeterminateList(self):
     assert_equal(
         rcmp.ComparisonList(
             [[self.testfilenames[0]], [self.testfilenames[1]]],
             comparators=[
                 rcmp.InodeComparator,
             ],
             exit_asap=self.exit_asap).cmp(), False)
示例#6
0
文件: tests.py 项目: rich-pixley/rcmp
 def testInodeList(self):
     assert_equal(
         rcmp.ComparisonList(
             [[self.testfilenames[0]], [self.testfilenames[0]]],
             comparators=[
                 rcmp.InodeComparator,
             ],
             exit_asap=self.exit_asap).cmp(), rcmp.Same)
示例#7
0
文件: tests.py 项目: rich-pixley/rcmp
 def testEmptyList(self):
     rcmp.ComparisonList([[self.testfilenames[0]], [self.testfilenames[0]]],
                         comparators=[],
                         exit_asap=self.exit_asap).cmp()