summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r--rdiff-backup/testing/journaltest.py18
-rw-r--r--rdiff-backup/testing/regresstest.py11
-rw-r--r--rdiff-backup/testing/timetest.py14
3 files changed, 23 insertions, 20 deletions
diff --git a/rdiff-backup/testing/journaltest.py b/rdiff-backup/testing/journaltest.py
index 76e638a..9db1ff2 100644
--- a/rdiff-backup/testing/journaltest.py
+++ b/rdiff-backup/testing/journaltest.py
@@ -6,20 +6,26 @@ class JournalTest(unittest.TestCase):
def testBasic(self):
"""Test opening a journal, then reading, writing, and deleting"""
MakeOutputDir()
- Globals.rbdir = rpath.RPath(Globals.local_connection,
- "testfiles/output")
+ Globals.dest_root = rpath.RPath(Globals.local_connection,
+ "testfiles/output")
+ Globals.rbdir = Globals.dest_root.append("rdiff-backup-data")
+
+ Globals.rbdir.mkdir()
journal.open_journal()
assert len(journal.get_entries_from_journal()) == 0
# It's important that none of these files really exist
- e1 = journal.write_entry("Hello48", "reg", "inc_file3917", "t39p")
- e2 = journal.write_entry("2nd_euoeuo", None, "inc_file4832", "l389")
+ e1 = journal.write_entry(("Hello48",), ("temp_index", "foo"),
+ 2, "reg")
+ e2 = journal.write_entry(("2nd", "Entry", "now"),
+ ("temp_index",), 1, None)
assert e1.entry_rp and e2.entry_rp
l = journal.get_entries_from_journal()
assert len(l) == 2
- first_filename = l[0].test_filename
- assert first_filename == "Hello48" or first_filename == "2nd_euoeuo"
+ first_index = l[0].index
+ assert (first_index == ("Hello48",) or
+ first_index == ("2nd", "Entry", "now"))
# Now test recovering journal, and make sure everything deleted
journal.recover_journal()
diff --git a/rdiff-backup/testing/regresstest.py b/rdiff-backup/testing/regresstest.py
new file mode 100644
index 0000000..8a24958
--- /dev/null
+++ b/rdiff-backup/testing/regresstest.py
@@ -0,0 +1,11 @@
+"""regresstest - test the regress module. Not to be confused with the
+regression tests."""
+
+import unittest
+from commontest import *
+
+class RegressTest(unittest.TestCase):
+ XXX
+
+
+if __name__ == "__main__": unittest.main()
diff --git a/rdiff-backup/testing/timetest.py b/rdiff-backup/testing/timetest.py
index 367a4f9..f7c28e1 100644
--- a/rdiff-backup/testing/timetest.py
+++ b/rdiff-backup/testing/timetest.py
@@ -32,20 +32,6 @@ class TimeTest(unittest.TestCase):
assert cmp("2001-09-01T12:00:00-08:00",
"2001-09-01T12:00:00-07:00") == 1
- def testCmp_separator(self):
- """Like testCmp but with new separator"""
- Globals.time_separator = "_"
- cmp = Time.cmp
- assert cmp(1,2) == -1
- assert cmp(2,2) == 0
- assert cmp(5,1) == 1
- assert cmp("2001-09-01T21_49_04Z", "2001-08-01T21_49_04Z") == 1
- assert cmp("2001-09-01T04_49_04+03_23", "2001-09-01T21_49_04Z") == -1
- assert cmp("2001-09-01T12_00_00Z", "2001-09-01T04_00_00-08_00") == 0
- assert cmp("2001-09-01T12_00_00-08_00",
- "2001-09-01T12_00_00-07_00") == 1
- Globals.time_separator = ":"
-
def testStringtotime(self):
"""Test converting string to time"""
timesec = int(time.time())