Commit aacdc6f6 authored by bescoto's avatar bescoto

Updated inctest - before it would compare increment attributes too strictly


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@612 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent bb58abe1
......@@ -352,7 +352,8 @@ class RORPath:
def equal_verbose(self, other, check_index = 1,
compare_inodes = 0, compare_ownership = 0,
compare_acls = 0, compare_eas = 0, verbosity = 2):
compare_acls = 0, compare_eas = 0, compare_size = 1,
compare_type = 1, verbosity = 2):
"""Like __eq__, but log more information. Useful when testing"""
if check_index and self.index != other.index:
log.Log("Index %s != index %s" % (self.index, other.index),
......@@ -364,10 +365,11 @@ class RORPath:
(self.issym() or not compare_ownership)):
# Don't compare gid/uid for symlinks, or if told not to
pass
elif key == 'type' and not compare_type: pass
elif key == 'atime' and not Globals.preserve_atime: pass
elif key == 'ctime': pass
elif key == 'devloc' or key == 'nlink': pass
elif key == 'size' and not self.isreg(): pass
elif key == 'size' and (not self.isreg() or not compare_size): pass
elif key == 'inode' and (not self.isreg() or not compare_inodes):
pass
elif key == 'ea' and not compare_eas: pass
......
......@@ -55,7 +55,7 @@ class inctest(unittest.TestCase):
diffrp = increment.Increment(rf, exec1, target)
assert diffrp.isreg(), diffrp
assert rpath.cmp_attribs(diffrp, exec1)
assert diffrp.equal_verbose(exec1, check_index = 0, compare_size = 0)
self.check_time(diffrp)
assert diffrp.getinctype() == 'diff', diffrp.getinctype()
diffrp.delete()
......@@ -78,7 +78,7 @@ class inctest(unittest.TestCase):
snap_rp2 = increment.Increment(sym, rf, target)
self.check_time(snap_rp2)
assert rpath.cmp_attribs(snap_rp2, rf)
assert snap_rp2.equal_verbose(rf, check_index = 0)
assert rpath.cmp(snap_rp2, rf)
snap_rp2.delete()
......@@ -87,13 +87,13 @@ class inctest(unittest.TestCase):
Globals.compression = 1
rp = increment.Increment(rf, sym, target)
self.check_time(rp)
assert rpath.cmp_attribs(rp, sym)
assert rp.equal_verbose(sym, check_index = 0, compare_size = 0)
assert rpath.cmp(rp, sym)
rp.delete()
rp = increment.Increment(sym, rf, target)
self.check_time(rp)
assert rpath.cmp_attribs(rp, rf)
assert rp.equal_verbose(rf, check_index = 0, compare_size = 0)
assert rpath.cmpfileobj(rp.open("rb", 1), rf.open("rb"))
assert rp.isinccompressed()
rp.delete()
......@@ -104,7 +104,8 @@ class inctest(unittest.TestCase):
self.check_time(rp)
assert rp.lstat()
assert target.isdir()
assert rpath.cmp_attribs(dir, rp)
assert dir.equal_verbose(rp, check_index = 0,
compare_size = 0, compare_type = 0)
assert rp.isreg()
rp.delete()
target.delete()
......@@ -114,7 +115,7 @@ class inctest(unittest.TestCase):
Globals.compression = None
rp = increment.Increment(rf, rf2, target)
self.check_time(rp)
assert rpath.cmp_attribs(rp, rf2)
assert rp.equal_verbose(rf2, check_index = 0, compare_size = 0)
Rdiff.patch_local(rf, rp, out2)
assert rpath.cmp(rf2, out2)
rp.delete()
......@@ -125,7 +126,7 @@ class inctest(unittest.TestCase):
Globals.compression = 1
rp = increment.Increment(rf, rf2, target)
self.check_time(rp)
assert rpath.cmp_attribs(rp, rf2)
assert rp.equal_verbose(rf2, check_index = 0, compare_size = 0)
Rdiff.patch_local(rf, rp, out2, delta_compressed = 1)
assert rpath.cmp(rf2, out2)
rp.delete()
......@@ -139,7 +140,7 @@ class inctest(unittest.TestCase):
rp = increment.Increment(rf, out_gz, target)
self.check_time(rp)
assert rpath.cmp_attribs(rp, out_gz)
assert rp.equal_verbose(out_gz, check_index = 0, compare_size = 0)
Rdiff.patch_local(rf, rp, out2)
assert rpath.cmp(out_gz, out2)
rp.delete()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment