diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-08-08 22:08:30 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-08-08 22:08:30 +0000 |
commit | 918f49e645474382251bfddbb0a2e030051083ef (patch) | |
tree | 01fada4bbee6dd26f5503a7a7295b1c9f9f63a9c /Lib/bsddb/test/test_cursor_pget_bug.py | |
parent | eb29e9ab2b037db198591a9cacb5993385c7f83d (diff) | |
download | cpython-git-918f49e645474382251bfddbb0a2e030051083ef.tar.gz |
Fix most of the bsddb3 tests.
Diffstat (limited to 'Lib/bsddb/test/test_cursor_pget_bug.py')
-rw-r--r-- | Lib/bsddb/test/test_cursor_pget_bug.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Lib/bsddb/test/test_cursor_pget_bug.py b/Lib/bsddb/test/test_cursor_pget_bug.py index de47e6d046..ac60cb4acd 100644 --- a/Lib/bsddb/test/test_cursor_pget_bug.py +++ b/Lib/bsddb/test/test_cursor_pget_bug.py @@ -1,12 +1,7 @@ import unittest import sys, os, glob -try: - # For Pythons w/distutils pybsddb - from bsddb3 import db -except ImportError: - # For Python 2.3 - from bsddb import db +from bsddb import db #---------------------------------------------------------------------- @@ -29,9 +24,9 @@ class pget_bugTestCase(unittest.TestCase): self.secondary_db.set_flags(db.DB_DUP) self.secondary_db.open(self.db_name, 'secondary', db.DB_BTREE, db.DB_CREATE) self.primary_db.associate(self.secondary_db, lambda key, data: data) - self.primary_db.put('salad', 'eggs') - self.primary_db.put('spam', 'ham') - self.primary_db.put('omelet', 'eggs') + self.primary_db.put(b'salad', b'eggs') + self.primary_db.put(b'spam', b'ham') + self.primary_db.put(b'omelet', b'eggs') def tearDown(self): @@ -48,11 +43,11 @@ class pget_bugTestCase(unittest.TestCase): def test_pget(self): cursor = self.secondary_db.cursor() - self.assertEquals(('eggs', 'salad', 'eggs'), cursor.pget(key='eggs', flags=db.DB_SET)) - self.assertEquals(('eggs', 'omelet', 'eggs'), cursor.pget(db.DB_NEXT_DUP)) + self.assertEquals((b'eggs', b'salad', b'eggs'), cursor.pget(key=b'eggs', flags=db.DB_SET)) + self.assertEquals((b'eggs', b'omelet', b'eggs'), cursor.pget(db.DB_NEXT_DUP)) self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) - self.assertEquals(('ham', 'spam', 'ham'), cursor.pget('ham', 'spam', flags=db.DB_SET)) + self.assertEquals((b'ham', b'spam', b'ham'), cursor.pget(b'ham', b'spam', flags=db.DB_SET)) self.assertEquals(None, cursor.pget(db.DB_NEXT_DUP)) cursor.close() |