diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-25 18:04:45 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-25 18:04:45 +0000 |
commit | 2caa9e388288e044183b45d18542a31fa1f4d4af (patch) | |
tree | 33af095ff4e665be96010e76cb03188e163d17a8 /rdiff-backup/testing/selectiontest.py | |
parent | aa36fa26a216b2faf89b0bbd4d90fb16fd082f38 (diff) | |
download | rdiff-backup-2caa9e388288e044183b45d18542a31fa1f4d4af.tar.gz |
Added root selection test, and modified tests to jive with new
IterTreeReducer fast_process code.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@146 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing/selectiontest.py')
-rw-r--r-- | rdiff-backup/testing/selectiontest.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/rdiff-backup/testing/selectiontest.py b/rdiff-backup/testing/selectiontest.py index 945d427..76af96f 100644 --- a/rdiff-backup/testing/selectiontest.py +++ b/rdiff-backup/testing/selectiontest.py @@ -224,9 +224,12 @@ testfiles/select/1/1 class ParseArgsTest(unittest.TestCase): """Test argument parsing""" + root = None def ParseTest(self, tuplelist, indicies, filelists = []): """No error if running select on tuple goes over indicies""" - self.root = DSRPath(1, Globals.local_connection, "testfiles/select") + if not self.root: + self.root = DSRPath(1, Globals.local_connection, + "testfiles/select") self.Select = Select(self.root) self.Select.ParseArgs(tuplelist, filelists) self.Select.set_iter() @@ -278,6 +281,32 @@ class ParseArgsTest(unittest.TestCase): ('3', '3'), ('3', '3', '2')]) + def testGlob2(self): + """Test more globbing functions""" + self.ParseTest([("--include", "testfiles/select/*foo*/p*"), + ("--exclude", "**")], + [(), ('efools',), ('efools', 'ping'), + ('foobar',), ('foobar', 'pong')]) + self.ParseTest([("--exclude", "testfiles/select/1/1/*"), + ("--exclude", "testfiles/select/1/2/**"), + ("--exclude", "testfiles/select/1/3**"), + ("--include", "testfiles/select/1"), + ("--exclude", "**")], + [(), ('1',), ('1', '1'), ('1', '2')]) + + def testAlternateRoot(self): + """Test select with different root""" + self.root = DSRPath(1, Globals.local_connection, + "testfiles/select/1") + self.ParseTest([("--exclude", "testfiles/select/1/[23]")], + [(), ('1',), ('1', '1'), ('1', '2'), ('1', '3')]) + + self.root = DSRPath(1, Globals.local_connection, "/") + self.ParseTest([("--exclude", "/home/*"), + ("--include", "/home"), + ("--exclude", "/")], + [(), ("home",)]) + def testParseStartingFrom(self): """Test parse, this time starting from inside""" self.root = DSRPath(1, Globals.local_connection, "testfiles/select") |