summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-03-15 19:30:08 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-03-15 19:30:08 +0000
commit42aa5f8cf76abd0a535f9205a8376dcb702a2a76 (patch)
tree7d2f19e991a572141a43df025fd4d3335af06465 /rdiff-backup/testing
parenta3aff7945f8d606bc14972e6107d0fa5e262e0b4 (diff)
downloadrdiff-backup-42aa5f8cf76abd0a535f9205a8376dcb702a2a76.tar.gz
Final changes for 0.11.4
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@301 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r--rdiff-backup/testing/metadatatest.py2
-rw-r--r--rdiff-backup/testing/statisticstest.py22
-rw-r--r--rdiff-backup/testing/test_with_profiling.py7
3 files changed, 9 insertions, 22 deletions
diff --git a/rdiff-backup/testing/metadatatest.py b/rdiff-backup/testing/metadatatest.py
index 7b6a91a..ed7e07c 100644
--- a/rdiff-backup/testing/metadatatest.py
+++ b/rdiff-backup/testing/metadatatest.py
@@ -8,7 +8,7 @@ class MetadataTest(unittest.TestCase):
def make_temp(self):
"""Make temp directory testfiles/output"""
global tempdir
- tempdir.delete()
+ if tempdir.lstat(): tempdir.delete()
tempdir.mkdir()
def testQuote(self):
diff --git a/rdiff-backup/testing/statisticstest.py b/rdiff-backup/testing/statisticstest.py
index 85a1b68..b198b61 100644
--- a/rdiff-backup/testing/statisticstest.py
+++ b/rdiff-backup/testing/statisticstest.py
@@ -180,26 +180,6 @@ class IncStatTest(unittest.TestCase):
rbdir = rpath.RPath(Globals.local_connection,
"testfiles/output/rdiff-backup-data")
- #incs = Restore.get_inclist(rbdir.append("subdir").
- # append("directory_statistics"))
- #assert len(incs) == 2
- #s1 = StatsObj().read_stats_from_rp(incs[0]) # initial mirror stats
- #assert s1.SourceFiles == 2
- #assert 400000 < s1.SourceFileSize < 420000
- #self.stats_check_initial(s1)
-
- #subdir_stats = StatsObj().read_stats_from_rp(incs[1]) # increment stats
- #assert subdir_stats.SourceFiles == 2
- #assert 400000 < subdir_stats.SourceFileSize < 420000
- #assert subdir_stats.MirrorFiles == 2
- #assert 400000 < subdir_stats.MirrorFileSize < 420000
- #assert subdir_stats.NewFiles == subdir_stats.NewFileSize == 0
- #assert subdir_stats.DeletedFiles == subdir_stats.DeletedFileSize == 0
- #assert subdir_stats.ChangedFiles == 2
- #assert 400000 < subdir_stats.ChangedSourceSize < 420000
- #assert 400000 < subdir_stats.ChangedMirrorSize < 420000
- #assert 10 < subdir_stats.IncrementFileSize < 20000
-
incs = restore.get_inclist(rbdir.append("session_statistics"))
assert len(incs) == 2
s2 = statistics.StatsObj().read_stats_from_rp(incs[0])
@@ -214,7 +194,7 @@ class IncStatTest(unittest.TestCase):
assert 700000 <= root_stats.MirrorFileSize < 750000
assert root_stats.NewFiles == 1
assert root_stats.NewFileSize == 0
- assert root_stats.DeletedFiles == 1
+ assert root_stats.DeletedFiles == 1, root_stats.DeletedFiles
assert root_stats.DeletedFileSize == 200000
assert 3 <= root_stats.ChangedFiles <= 4, root_stats.ChangedFiles
assert 450000 <= root_stats.ChangedSourceSize < 470000
diff --git a/rdiff-backup/testing/test_with_profiling.py b/rdiff-backup/testing/test_with_profiling.py
new file mode 100644
index 0000000..13aefa3
--- /dev/null
+++ b/rdiff-backup/testing/test_with_profiling.py
@@ -0,0 +1,7 @@
+import profile, pstats
+from metadatatest import *
+
+profile.run("unittest.main()", "profile-output")
+p = pstats.Stats("profile-output")
+p.sort_stats('time')
+p.print_stats(40)