summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm_gnu.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dbm_gnu.py')
-rwxr-xr-xLib/test/test_dbm_gnu.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index dad56e6..ce96ce4 100755
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -32,6 +32,10 @@ class TestGdbm(unittest.TestCase):
key_set.remove(key)
key = self.g.nextkey(key)
self.assertRaises(KeyError, lambda: self.g['xxx'])
+ # get() and setdefault() work as in the dict interface
+ self.assertEqual(self.g.get(b'xxx', b'foo'), b'foo')
+ self.assertEqual(self.g.setdefault(b'xxx', b'foo'), b'foo')
+ self.assertEqual(self.g[b'xxx'], b'foo')
def test_error_conditions(self):
# Try to open a non-existent database.