From: W. Trevor King Date: Mon, 28 Dec 2009 16:13:49 +0000 (-0500) Subject: Added VersionedStorage_commit_TestCase.test_commit_revision_ids() X-Git-Tag: 1.0.0~59^2~52^2~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d6ed9ec7181ef805f305c6c8b7152c1b9ec6ec8;p=be.git Added VersionedStorage_commit_TestCase.test_commit_revision_ids() --- diff --git a/libbe/storage/base.py b/libbe/storage/base.py index d99c22c..9807d86 100644 --- a/libbe/storage/base.py +++ b/libbe/storage/base.py @@ -827,6 +827,29 @@ if TESTING == True: "%s.get() returned %s not %s for revision %s" % (vars(self.Class)['name'], ret, val(i), revs[i])) + def test_get_previous_children(self): + """ + Children list should be revision dependent. + """ + self.s.add('parent', directory=True) + revs = [] + cur_children = [] + children = [] + for i in range(10): + new_child = str(i) + self.s.add(new_child, 'parent', directory=False) + self.s.set(new_child, self.val) + revs.append(self.s.commit('%s: %d' % (self.commit_msg, i), + self.commit_body)) + cur_children.append(new_child) + children.append(list(cur_children)) + for i in range(10): + ret = self.s.children('parent', revision=revs[i]) + self.failUnless(ret == children[i], + "%s.get() returned %s not %s for revision %s" + % (vars(self.Class)['name'], ret, + children[i], revs[i])) + def make_storage_testcase_subclasses(storage_class, namespace): """Make StorageTestCase subclasses for storage_class in namespace.""" storage_testcase_classes = [