diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-11-25 19:19:17 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-11-25 19:19:17 (GMT) |
commit | 7317c1ef7aaba7deda66b7fa917d09e68d83635b (patch) | |
tree | 20de56e7bef3651ffbe837660673f76a1b54a1c5 /Lib/test/test_dbm_ndbm.py | |
parent | 50d5a1c37324405104a097389515a0ef4f9705f3 (diff) | |
download | cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.zip cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.tar.gz cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.tar.bz2 |
dbm.gnu and dbm.ndbm accept both strings and bytes as keys and values. For the
former they are converted to bytes before being written to the DB.
Closes issue 3799. Reviewed by Skip Montanaro.
Diffstat (limited to 'Lib/test/test_dbm_ndbm.py')
-rwxr-xr-x | Lib/test/test_dbm_ndbm.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py index 74d3238..6d0a36d 100755 --- a/Lib/test/test_dbm_ndbm.py +++ b/Lib/test/test_dbm_ndbm.py @@ -20,9 +20,11 @@ class DbmTestCase(unittest.TestCase): self.d = dbm.ndbm.open(self.filename, 'c') self.assert_(self.d.keys() == []) self.d['a'] = 'b' + self.d[b'bytes'] = b'data' self.d['12345678910'] = '019237410982340912840198242' self.d.keys() self.assert_(b'a' in self.d) + self.assertEqual(self.d[b'bytes'], b'data') self.d.close() def test_modes(self): |