diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-12-23 06:53:18 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-12-23 06:53:18 +0000 |
commit | 9a0da726e2172321cdc1dcd21441f4ffc41e7931 (patch) | |
tree | 7f25f848386ca501b7f08c08c21af16f0d71330c /rdiff-backup/testing/regressiontest.py | |
parent | e95a61773adb2f98499cf13ff543f4249ee38226 (diff) | |
download | rdiff-backup-9a0da726e2172321cdc1dcd21441f4ffc41e7931.tar.gz |
Major refactoring - avoid use of 'from XX import *' in favor of more
normal 'import XXX' syntax. The previous way was an artifact from
earlier versions where the whole program fit in one file.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@252 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing/regressiontest.py')
-rw-r--r-- | rdiff-backup/testing/regressiontest.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/rdiff-backup/testing/regressiontest.py b/rdiff-backup/testing/regressiontest.py index e881b63..0391f95 100644 --- a/rdiff-backup/testing/regressiontest.py +++ b/rdiff-backup/testing/regressiontest.py @@ -1,8 +1,6 @@ import unittest, os from commontest import * -from rdiff_backup.log import * -from rdiff_backup.rpath import * -from rdiff_backup import Globals, SetConnections +from rdiff_backup import Globals, SetConnections, log, rpath """Regression tests @@ -14,13 +12,13 @@ testfiles Globals.set('change_source_perms', 1) Globals.counter = 0 -Log.setverbosity(7) +log.Log.setverbosity(7) class Local: """This is just a place to put increments relative to the local connection""" def get_local_rp(extension): - return RPath(Globals.local_connection, "testfiles/" + extension) + return rpath.RPath(Globals.local_connection, "testfiles/" + extension) inc1rp = get_local_rp('increment1') inc2rp = get_local_rp('increment2') @@ -55,10 +53,10 @@ class PathSetter(unittest.TestCase): else: return ('./', Globals.local_connection) def get_src_rp(self, path): - return RPath(self.src_conn, self.src_prefix + path) + return rpath.RPath(self.src_conn, self.src_prefix + path) def get_dest_rp(self, path): - return RPath(self.dest_conn, self.dest_prefix + path) + return rpath.RPath(self.dest_conn, self.dest_prefix + path) def set_rbdir(self, rpout): """Create rdiff-backup-data dir if not already, tell everyone""" @@ -89,9 +87,10 @@ class PathSetter(unittest.TestCase): self.get_prefix_and_conn(dest_path, dest_return) SetConnections.BackupInitConnections(self.src_conn, self.dest_conn) - os.system(MiscDir+"/myrm testfiles/output* testfiles/restoretarget* " - "testfiles/noperms_output testfiles/root_output " - "testfiles/unreadable_out") + assert not os.system("rm -rf testfiles/output* " + "testfiles/restoretarget* " + "testfiles/noperms_output testfiles/root_output " + "testfiles/unreadable_out") self.inc1rp = self.get_src_rp("testfiles/increment1") self.inc2rp = self.get_src_rp('testfiles/increment2') @@ -157,7 +156,7 @@ class IncrementTest1(unittest.TestCase): class IncrementTest2(PathSetter): def OldtestRecoveryLocal(self): """Test to see if rdiff-backup can continue with bad increment""" - os.system(MiscDir+'/myrm testfiles/recovery_out_backup') + assert not os.system("rm -rf testfiles/recovery_out_backup") self.setPathnames(None, None, None, None) Time.setprevtime(1006136450) Time.setcurtime() @@ -174,7 +173,7 @@ class IncrementTest2(PathSetter): def OldtestRecoveryRemote(self): """Test Recovery with both connections remote""" - os.system(MiscDir+'/myrm testfiles/recovery_out_backup') + assert not os.system('rm -rf testfiles/recovery_out_backup') self.setPathnames('test1', '../', 'test2/tmp', '../../') Time.setprevtime(1006136450) Time.setcurtime() @@ -360,7 +359,7 @@ class MirrorTest(PathSetter): Globals.change_source_perms = 1 def deleteoutput(self): - os.system(MiscDir+"/myrm testfiles/output*") + assert not os.system("rm -rf testfiles/output*") self.rbdir = self.rpout.append('rdiff-backup-data') self.rpout.mkdir() self.rbdir.mkdir() @@ -395,7 +394,7 @@ class MirrorTest(PathSetter): Time.setcurtime() SaveState.init_filenames() self.Mirror(self.inc1rp, self.rpout) - #RPath.copy_attribs(self.inc1rp, self.rpout) + #rpath.RPath.copy_attribs(self.inc1rp, self.rpout) assert CompareRecursive(Local.inc1rp, Local.rpout) self.Mirror(self.inc2rp, self.rpout) |