diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-07-24 20:13:09 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-07-24 20:13:09 +0000 |
commit | 1849a51fdc22a23ffbe9214a8421df9d082e33a7 (patch) | |
tree | 3057009ef5b197f7f30ed4928c6df233f30b96ae | |
parent | 38627e1ab5e21c649357748d7ee52001989d0594 (diff) | |
download | mongo-1849a51fdc22a23ffbe9214a8421df9d082e33a7.tar.gz |
Put tests that only need to run once in a separate class without
scenarios, so they only run once.
-rw-r--r-- | test/suite/test_truncate.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/suite/test_truncate.py b/test/suite/test_truncate.py index 7b7dfdafb58..d0b3012dbf0 100644 --- a/test/suite/test_truncate.py +++ b/test/suite/test_truncate.py @@ -34,7 +34,20 @@ import wiredtiger, wttest from helper import confirmDoesNotExist, \ confirmEmpty, complexPopulate, keyPopulate, simplePopulate +# Test session.truncate +# Simple, one-off tests. +class test_truncate_standalone(wttest.WiredTigerTestCase): + + # Test truncation of an object without URI or either cursor specified, + # expect an error. + def test_truncate_no_args(self): + simplePopulate(self, 'file:xxx', 'key_format=S', 10) + msg = '/either a URI or start/stop cursors/' + self.assertRaisesWithMessage(wiredtiger.WiredTigerError, + lambda: self.session.truncate(None, None, None, None), msg) + # Test session.truncate. +# Scenarios. class test_truncate(wttest.WiredTigerTestCase): name = 'test_truncate' @@ -52,14 +65,6 @@ class test_truncate(wttest.WiredTigerTestCase): ('table-row-big', dict(type='table:',fmt='S',nentries=10000,skip=737)) ] - # Test truncation of an object without URI or either cursor. - def test_truncate_not_set(self): - uri = self.type + self.name - simplePopulate(self, uri, self.config + self.fmt, 10) - msg = '/either a URI or start/stop cursors/' - self.assertRaisesWithMessage(wiredtiger.WiredTigerError, - lambda: self.session.truncate(None, None, None, None), msg) - # Test truncation of an object using its URI. def test_truncate(self): uri = self.type + self.name |