diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-04-12 04:18:41 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-04-12 04:18:41 +0000 |
commit | f0b35195e0832dcc91d485010f2503902d78eaf8 (patch) | |
tree | c0bc628153462fb925ee9ce4ab24dc1c1e50852b /rdiff-backup/testing/destructive_steppingtest.py | |
parent | ae666de6c68c36daa946946303196f8be96e9cfe (diff) | |
download | rdiff-backup-f0b35195e0832dcc91d485010f2503902d78eaf8.tar.gz |
Changed testfiles, testing code to deal with Select instead of DS.Iterate
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@44 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing/destructive_steppingtest.py')
-rw-r--r-- | rdiff-backup/testing/destructive_steppingtest.py | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/rdiff-backup/testing/destructive_steppingtest.py b/rdiff-backup/testing/destructive_steppingtest.py index 528561d..b44a999 100644 --- a/rdiff-backup/testing/destructive_steppingtest.py +++ b/rdiff-backup/testing/destructive_steppingtest.py @@ -1,7 +1,7 @@ from __future__ import generators import unittest execfile("commontest.py") -rbexec("destructive_stepping.py") +rbexec("selection.py") @@ -15,13 +15,15 @@ class DSTest(unittest.TestCase): def testDSIter(self): """Testing destructive stepping iterator from baserp""" for i in range(2): - ds_iter = DestructiveStepping.Iterate_with_Finalizer( - self.noperms, 1) + sel = Select(self.noperms, 1) + sel.set_iter() + ds_iter = sel.iterate_with_finalizer() noperms = ds_iter.next() assert noperms.isdir() and noperms.getperms() == 0 bar = ds_iter.next() - assert bar.isreg() and bar.getperms() == 0 + assert bar.isreg() and bar.getperms() == 0, \ + "%s %s" % (bar.isreg(), bar.getperms()) barbuf = bar.open("rb").read() assert len(barbuf) > 0 @@ -36,37 +38,4 @@ class DSTest(unittest.TestCase): self.assertRaises(StopIteration, ds_iter.next) - def testIterate_from(self): - """Tests basic iteration by Iterate_from""" - iter = DestructiveStepping.Iterate_from(self.iteration_dir, 1) - l = [] - for rp in iter: l.append(rp.index) - assert l == [(), - ('1',), - ('2',), - ('3',), ('3','2'), ('3','3'), - ('4',), - ('5',), ('5','1'), ('5','2'), ('5','2','1'), - ('6',), ('6','3'), - ('6','3','1'), ('6','3','2'), ('6','4'), - ('7',)], l - - def testIterate_from_index(self): - """Test iteration from a given index""" - iter = DestructiveStepping.Iterate_from(self.iteration_dir, 1, ('3',)) - l = [] - for rp in iter: l.append(rp.index) - assert l == [('3','2'), ('3','3'), - ('4',), - ('5',), ('5','1'), ('5','2'), ('5','2','1'), - ('6',), ('6','3'), - ('6','3','1'), ('6','3','2'), ('6','4'), - ('7',)], l - iter = DestructiveStepping.Iterate_from(self.iteration_dir, 1, - ('6','3')) - l = [] - for rp in iter: l.append(rp.index) - assert l == [('6','3','1'), ('6','3','2'), ('6', '4'), - ('7',)], l - if __name__ == "__main__": unittest.main() |