summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing/rpathtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/testing/rpathtest.py')
-rw-r--r--rdiff-backup/testing/rpathtest.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/rdiff-backup/testing/rpathtest.py b/rdiff-backup/testing/rpathtest.py
index fe19d03..3b2939f 100644
--- a/rdiff-backup/testing/rpathtest.py
+++ b/rdiff-backup/testing/rpathtest.py
@@ -1,7 +1,7 @@
import os, cPickle, sys, unittest
from commontest import *
from rdiff_backup.rpath import *
-
+from rdiff_backup import rpath
class RPathTest(unittest.TestCase):
lc = Globals.local_connection
@@ -313,18 +313,18 @@ class FileCopying(RPathTest):
def testComp(self):
"""Test comparisons involving regular files"""
- assert RPath.cmp(self.hl1, self.hl2)
- assert not RPath.cmp(self.rf, self.hl1)
- assert not RPath.cmp(self.dir, self.rf)
+ assert rpath.cmp(self.hl1, self.hl2)
+ assert not rpath.cmp(self.rf, self.hl1)
+ assert not rpath.cmp(self.dir, self.rf)
def testCompMisc(self):
"""Test miscellaneous comparisons"""
- assert RPath.cmp(self.dir, RPath(self.lc, self.mainprefix, ()))
+ assert rpath.cmp(self.dir, RPath(self.lc, self.mainprefix, ()))
self.dest.symlink("regular_file")
- assert RPath.cmp(self.sl, self.dest)
+ assert rpath.cmp(self.sl, self.dest)
self.dest.delete()
- assert not RPath.cmp(self.sl, self.fifo)
- assert not RPath.cmp(self.dir, self.sl)
+ assert not rpath.cmp(self.sl, self.fifo)
+ assert not rpath.cmp(self.dir, self.sl)
def testDirSizeComp(self):
"""Make sure directories can be equal,
@@ -338,10 +338,10 @@ class FileCopying(RPathTest):
def testCopy(self):
"""Test copy of various files"""
for rp in [self.sl, self.rf, self.fifo, self.dir]:
- RPath.copy(rp, self.dest)
+ rpath.copy(rp, self.dest)
assert self.dest.lstat(), "%s doesn't exist" % self.dest.path
- assert RPath.cmp(rp, self.dest)
- assert RPath.cmp(self.dest, rp)
+ assert rpath.cmp(rp, self.dest)
+ assert rpath.cmp(self.dest, rp)
self.dest.delete()
@@ -361,8 +361,8 @@ class FileAttributes(FileCopying):
"""Test attribute comparison success"""
testpairs = [(self.hl1, self.hl2)]
for a, b in testpairs:
- assert RPath.cmp_attribs(a, b), "Err with %s %s" % (a.path, b.path)
- assert RPath.cmp_attribs(b, a), "Err with %s %s" % (b.path, a.path)
+ assert rpath.cmp_attribs(a, b), "Err with %s %s" % (a.path, b.path)
+ assert rpath.cmp_attribs(b, a), "Err with %s %s" % (b.path, a.path)
def testCompFail(self):
"""Test attribute comparison failures"""
@@ -370,16 +370,16 @@ class FileAttributes(FileCopying):
(self.exec1, self.exec2),
(self.rf, self.hl1)]
for a, b in testpairs:
- assert not RPath.cmp_attribs(a, b), \
+ assert not rpath.cmp_attribs(a, b), \
"Err with %s %s" % (a.path, b.path)
- assert not RPath.cmp_attribs(b, a), \
+ assert not rpath.cmp_attribs(b, a), \
"Err with %s %s" % (b.path, a.path)
def testCompRaise(self):
"""Should raise exception when file missing"""
- self.assertRaises(RPathException, RPath.cmp_attribs,
+ self.assertRaises(RPathException, rpath.cmp_attribs,
self.nothing, self.hl1)
- self.assertRaises(RPathException, RPath.cmp_attribs,
+ self.assertRaises(RPathException, rpath.cmp_attribs,
self.noperms, self.nothing)
def testCopyAttribs(self):
@@ -389,8 +389,8 @@ class FileAttributes(FileCopying):
for rp in [self.noperms, self.nowrite, self.rf, self.exec1,
self.exec2, self.hl1, self.dir]:
t.touch()
- RPath.copy_attribs(rp, t)
- assert RPath.cmp_attribs(t, rp), \
+ rpath.copy_attribs(rp, t)
+ assert rpath.cmp_attribs(t, rp), \
"Attributes for file %s not copied successfully" % rp.path
t.delete()
@@ -400,16 +400,16 @@ class FileAttributes(FileCopying):
if out.lstat(): out.delete()
for rp in [self.noperms, self.nowrite, self.rf, self.exec1,
self.exec2, self.hl1, self.dir, self.sym]:
- RPath.copy_with_attribs(rp, out)
- assert RPath.cmp(rp, out)
- assert RPath.cmp_attribs(rp, out)
+ rpath.copy_with_attribs(rp, out)
+ assert rpath.cmp(rp, out)
+ assert rpath.cmp_attribs(rp, out)
out.delete()
def testCopyRaise(self):
"""Should raise exception for non-existent files"""
- self.assertRaises(RPathException, RPath.copy_attribs,
+ self.assertRaises(RPathException, rpath.copy_attribs,
self.hl1, self.nothing)
- self.assertRaises(RPathException, RPath.copy_attribs,
+ self.assertRaises(RPathException, rpath.copy_attribs,
self.nothing, self.nowrite)
class CheckPath(unittest.TestCase):