summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing/connectiontest.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/testing/connectiontest.py')
-rw-r--r--rdiff-backup/testing/connectiontest.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/rdiff-backup/testing/connectiontest.py b/rdiff-backup/testing/connectiontest.py
index 4c914fb..265862a 100644
--- a/rdiff-backup/testing/connectiontest.py
+++ b/rdiff-backup/testing/connectiontest.py
@@ -1,7 +1,7 @@
import unittest, types, tempfile, os, sys
from commontest import *
from rdiff_backup.connection import *
-from rdiff_backup import Globals
+from rdiff_backup import Globals, rpath
class LocalConnectionTest(unittest.TestCase):
"""Test the dummy connection"""
@@ -104,7 +104,7 @@ class PipeConnectionTest(unittest.TestCase):
"""Test module emulation"""
assert type(self.conn.tempfile.mktemp()) is types.StringType
assert self.conn.os.path.join("a", "b") == "a/b"
- rp1 = RPath(self.conn, self.regfilename)
+ rp1 = rpath.RPath(self.conn, self.regfilename)
assert rp1.isreg()
def testVirtualFiles(self):
@@ -112,17 +112,17 @@ class PipeConnectionTest(unittest.TestCase):
tempout = self.conn.open("testfiles/tempout", "w")
assert isinstance(tempout, VirtualFile)
regfilefp = open(self.regfilename, "r")
- RPath.copyfileobj(regfilefp, tempout)
+ rpath.copyfileobj(regfilefp, tempout)
tempout.close()
regfilefp.close()
tempoutlocal = open("testfiles/tempout", "r")
regfilefp = open(self.regfilename, "r")
- assert RPath.cmpfileobj(regfilefp, tempoutlocal)
+ assert rpath.cmpfileobj(regfilefp, tempoutlocal)
tempoutlocal.close()
regfilefp.close()
os.unlink("testfiles/tempout")
- assert RPath.cmpfileobj(self.conn.open(self.regfilename, "r"),
+ assert rpath.cmpfileobj(self.conn.open(self.regfilename, "r"),
open(self.regfilename, "r"))
def testString(self):
@@ -139,7 +139,8 @@ class PipeConnectionTest(unittest.TestCase):
def testRPaths(self):
"""Test transmission of rpaths"""
- rp = RPath(self.conn, "testfiles/various_file_types/regular_file")
+ rp = rpath.RPath(self.conn,
+ "testfiles/various_file_types/regular_file")
assert self.conn.reval("lambda rp: rp.data", rp) == rp.data
assert self.conn.reval("lambda rp: rp.conn is Globals.local_connection", rp)
@@ -192,7 +193,7 @@ class RedirectedConnectionTest(unittest.TestCase):
def testRpaths(self):
"""Test moving rpaths back and forth across connections"""
- rp = RPath(self.conna, "foo")
+ rp = rpath.RPath(self.conna, "foo")
self.connb.Globals.set("tmp_rpath", rp)
rp_returned = self.connb.Globals.get("tmp_rpath")
assert rp_returned.conn is rp.conn