diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-11-25 19:19:17 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-11-25 19:19:17 +0000 |
commit | 7317c1ef7aaba7deda66b7fa917d09e68d83635b (patch) | |
tree | 20de56e7bef3651ffbe837660673f76a1b54a1c5 /Lib/test/test_dbm_dumb.py | |
parent | 50d5a1c37324405104a097389515a0ef4f9705f3 (diff) | |
download | cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.tar.gz cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.zip |
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_dumb.py')
-rw-r--r-- | Lib/test/test_dbm_dumb.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py index 940991dae2d..e2964aad733 100644 --- a/Lib/test/test_dbm_dumb.py +++ b/Lib/test/test_dbm_dumb.py @@ -115,11 +115,13 @@ class DumbDBMTestCase(unittest.TestCase): self.init_db() f = dumbdbm.open(_fname) f['\u00fc'] = b'!' + f['1'] = 'a' f.close() f = dumbdbm.open(_fname, 'r') self.assert_('\u00fc' in f) self.assertEqual(f['\u00fc'.encode('utf-8')], self._dict['\u00fc'.encode('utf-8')]) + self.assertEqual(f[b'1'], b'a') def test_line_endings(self): # test for bug #1172763: dumbdbm would die if the line endings |