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)
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)
def testBitwiseIndeterminateList(self): assert_equal( rcmp.ComparisonList( [[self.testfilenames[0]], [self.testfilenames[1]]], comparators=[ rcmp.BitwiseComparator(), ]).cmp(), False)
def testBitwiseList(self): assert_equal( rcmp.ComparisonList( [[self.testfilenames[0]], [self.testfilenames[0]]], comparators=[ rcmp.BitwiseComparator(), ]).cmp(), rcmp.Same)
def testInodeIndeterminateList(self): assert_equal( rcmp.ComparisonList( [[self.testfilenames[0]], [self.testfilenames[1]]], comparators=[ rcmp.InodeComparator, ], exit_asap=self.exit_asap).cmp(), False)
def testInodeList(self): assert_equal( rcmp.ComparisonList( [[self.testfilenames[0]], [self.testfilenames[0]]], comparators=[ rcmp.InodeComparator, ], exit_asap=self.exit_asap).cmp(), rcmp.Same)
def testEmptyList(self): rcmp.ComparisonList([[self.testfilenames[0]], [self.testfilenames[0]]], comparators=[], exit_asap=self.exit_asap).cmp()