diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2004-01-13 19:59:57 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2004-01-13 19:59:57 (GMT) |
commit | e33aef7b159a24789cfa8f1fcf4462f6a4bab464 (patch) | |
tree | eee65a344b751d46bf3bbd00ea49582a19f15f4f /Lib/bsddb/test | |
parent | 2fb702966c9c7e29c2697cf0d9dc6b1a19e465d7 (diff) | |
download | cpython-e33aef7b159a24789cfa8f1fcf4462f6a4bab464.zip cpython-e33aef7b159a24789cfa8f1fcf4462f6a4bab464.tar.gz cpython-e33aef7b159a24789cfa8f1fcf4462f6a4bab464.tar.bz2 |
__init__.py: keep it compatible with older python (True and False == 1 and 0)
test_basics.py: updated for the set_get_returns_none() default of 2 change.
Diffstat (limited to 'Lib/bsddb/test')
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 93a7fb7..d757b34 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -290,7 +290,7 @@ class BasicTestCase(unittest.TestCase): #---------------------------------------- - def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=1): + def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=0): if verbose: print '\n', '-=' * 30 print "Running %s.test03_SimpleCursorStuff (get_error %s, set_error %s)..." % \ @@ -459,9 +459,20 @@ class BasicTestCase(unittest.TestCase): self.__class__.__name__ old = self.d.set_get_returns_none(0) - assert old == 1 + assert old == 2 self.test03_SimpleCursorStuff(get_raises_error=1, set_raises_error=1) + def test03b_SimpleCursorWithGetReturnsNone1(self): + # same test but raise exceptions instead of returning None + if verbose: + print '\n', '-=' * 30 + print "Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone..." % \ + self.__class__.__name__ + + old = self.d.set_get_returns_none(1) + self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=1) + + def test03c_SimpleCursorGetReturnsNone2(self): # same test but raise exceptions instead of returning None if verbose: @@ -469,10 +480,10 @@ class BasicTestCase(unittest.TestCase): print "Running %s.test03c_SimpleCursorStuffWithoutSetReturnsNone..." % \ self.__class__.__name__ + old = self.d.set_get_returns_none(1) + assert old == 2 old = self.d.set_get_returns_none(2) assert old == 1 - old = self.d.set_get_returns_none(2) - assert old == 2 self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0) #---------------------------------------- |