summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dumbdbm.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-02-22 05:04:32 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-02-22 05:04:32 (GMT)
commitc1b22a07c32481855af661f4d6888c9e361e9200 (patch)
tree19e21a52283bcfabc89e6498b567e2d0f542ec09 /Lib/test/test_dumbdbm.py
parentf0c82f9842c76a0b1c287c20d9e2061bbc134739 (diff)
downloadcpython-c1b22a07c32481855af661f4d6888c9e361e9200.zip
cpython-c1b22a07c32481855af661f4d6888c9e361e9200.tar.gz
cpython-c1b22a07c32481855af661f4d6888c9e361e9200.tar.bz2
Fix dumbdbm and test_dumbdbm to work with dict views. Bug in dumbdbm was from
dict views not being iterators but just iterables.
Diffstat (limited to 'Lib/test/test_dumbdbm.py')
-rw-r--r--Lib/test/test_dumbdbm.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/Lib/test/test_dumbdbm.py b/Lib/test/test_dumbdbm.py
index 041fac1..ba94d98 100644
--- a/Lib/test/test_dumbdbm.py
+++ b/Lib/test/test_dumbdbm.py
@@ -32,7 +32,7 @@ class DumbDBMTestCase(unittest.TestCase):
def test_dumbdbm_creation(self):
f = dumbdbm.open(_fname, 'c')
- self.assertEqual(f.keys(), [])
+ self.assertEqual(list(f.keys()), [])
for key in self._dict:
f[key] = self._dict[key]
self.read_helper(f)
@@ -128,10 +128,8 @@ class DumbDBMTestCase(unittest.TestCase):
f.close()
def keys_helper(self, f):
- keys = f.keys()
- keys.sort()
- dkeys = self._dict.keys()
- dkeys.sort()
+ keys = sorted(f.keys())
+ dkeys = sorted(self._dict.keys())
self.assertEqual(keys, dkeys)
return keys
@@ -156,10 +154,8 @@ class DumbDBMTestCase(unittest.TestCase):
f.close()
f = dumbdbm.open(_fname)
- expected = d.items()
- expected.sort()
- got = f.items()
- got.sort()
+ expected = sorted(d.items())
+ got = sorted(f.items())
self.assertEqual(expected, got)
f.close()