diff options
Diffstat (limited to 'rdiff-backup/testing/journaltest.py')
-rw-r--r-- | rdiff-backup/testing/journaltest.py | 18 |
1 files changed, 12 insertions, 6 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() |