summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-25 02:38:17 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-25 02:38:17 +0000
commit783b379388e400ce192b8c67e3c814cb56755f41 (patch)
treee476275d36edf05fbe659ad2b4c385d30cb68d9f /rdiff-backup/testing
parent2e5e834e37fad52f4e5471117b809ce68e6e88d3 (diff)
downloadrdiff-backup-783b379388e400ce192b8c67e3c814cb56755f41.tar.gz
Misc changes, passes all tests now
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@651 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r--rdiff-backup/testing/iterfiletest.py6
-rw-r--r--rdiff-backup/testing/statisticstest.py7
2 files changed, 9 insertions, 4 deletions
diff --git a/rdiff-backup/testing/iterfiletest.py b/rdiff-backup/testing/iterfiletest.py
index 2c357ef..4f3083d 100644
--- a/rdiff-backup/testing/iterfiletest.py
+++ b/rdiff-backup/testing/iterfiletest.py
@@ -41,11 +41,11 @@ class testIterFile(unittest.TestCase):
def testFileException(self):
"""Test encoding a file which raises an exception"""
- f = FileException(100*1024)
+ f = FileException(200*1024) # size depends on buffer size
new_iter = IterWrappingFile(FileWrappingIter(iter([f, "foo"])))
f_out = new_iter.next()
- assert f_out.read(10000) == "a"*10000
- try: buf = f_out.read(100*1024)
+ assert f_out.read(50000) == "a"*50000
+ try: buf = f_out.read(190*1024)
except IOError: pass
else: assert 0, len(buf)
diff --git a/rdiff-backup/testing/statisticstest.py b/rdiff-backup/testing/statisticstest.py
index 686c4ca..7402b44 100644
--- a/rdiff-backup/testing/statisticstest.py
+++ b/rdiff-backup/testing/statisticstest.py
@@ -171,6 +171,11 @@ class IncStatTest(unittest.TestCase):
could change with different file systems...
"""
+ def sorti(inclist):
+ l = [(inc.getinctime(), inc) for inc in inclist]
+ l.sort()
+ return [inc for (t, inc) in l]
+
Globals.compression = 1
Myrm("testfiles/output")
InternalBackup(1, 1, "testfiles/stattest1", "testfiles/output")
@@ -180,7 +185,7 @@ class IncStatTest(unittest.TestCase):
rbdir = rpath.RPath(Globals.local_connection,
"testfiles/output/rdiff-backup-data")
- incs = restore.get_inclist(rbdir.append("session_statistics"))
+ incs = sorti(restore.get_inclist(rbdir.append("session_statistics")))
assert len(incs) == 2
s2 = statistics.StatsObj().read_stats_from_rp(incs[0])
assert s2.SourceFiles == 7