diff options
Diffstat (limited to 'Lib/bsddb/test/test_get_none.py')
-rw-r--r-- | Lib/bsddb/test/test_get_none.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Lib/bsddb/test/test_get_none.py b/Lib/bsddb/test/test_get_none.py index d1b69c7..63130d5 100644 --- a/Lib/bsddb/test/test_get_none.py +++ b/Lib/bsddb/test/test_get_none.py @@ -7,12 +7,7 @@ import tempfile from pprint import pprint import unittest -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db +from bsddb import db from .test_all import verbose @@ -36,13 +31,14 @@ class GetReturnsNoneTestCase(unittest.TestCase): d.set_get_returns_none(1) for x in string.letters: + x = x.encode("ascii") d.put(x, x * 40) - data = d.get('bad key') + data = d.get(b'bad key') assert data == None - data = d.get('a') - assert data == 'a'*40 + data = d.get(b'a') + assert data == b'a'*40 count = 0 c = d.cursor() @@ -64,13 +60,14 @@ class GetReturnsNoneTestCase(unittest.TestCase): d.set_get_returns_none(0) for x in string.letters: + x = x.encode("ascii") d.put(x, x * 40) - self.assertRaises(db.DBNotFoundError, d.get, 'bad key') - self.assertRaises(KeyError, d.get, 'bad key') + self.assertRaises(db.DBNotFoundError, d.get, b'bad key') + self.assertRaises(KeyError, d.get, b'bad key') - data = d.get('a') - assert data == 'a'*40 + data = d.get(b'a') + assert data == b'a'*40 count = 0 exceptionHappened = 0 |