diff options
author | Guido van Rossum <guido@python.org> | 2006-08-18 22:13:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-18 22:13:04 (GMT) |
commit | e2b70bcf7401477936fba99a8bf4a1f759ecc8a3 (patch) | |
tree | 4c9b65b7fd8c26a3d2f1b64ecd6b4c72a756b4b2 /Lib/test/test_mailbox.py | |
parent | d2dbecb4ae9177e2e87adcb047147c6bcbf28cc1 (diff) | |
download | cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.zip cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.gz cpython-e2b70bcf7401477936fba99a8bf4a1f759ecc8a3.tar.bz2 |
Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint...
The C API still has PyDict_HasKey() and _HasKeyString(); not sure
if I want to change those just yet.
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r-- | Lib/test/test_mailbox.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 45dd118..04e856f 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -229,16 +229,9 @@ class TestMailbox(TestBase): count += 1 self.assert_(len(values) == count) - def test_has_key(self): - # Check existence of keys using has_key() - self._test_has_key_or_contains(self._box.has_key) - def test_contains(self): # Check existence of keys using __contains__() - self._test_has_key_or_contains(self._box.__contains__) - - def _test_has_key_or_contains(self, method): - # (Used by test_has_key() and test_contains().) + method = self._box.__contains__ self.assert_(not method('foo')) key0 = self._box.add(self._template % 0) self.assert_(method(key0)) @@ -442,7 +435,7 @@ class TestMailboxSuperclass(TestBase): self.assertRaises(NotImplementedError, lambda: box.get_message('')) self.assertRaises(NotImplementedError, lambda: box.get_string('')) self.assertRaises(NotImplementedError, lambda: box.get_file('')) - self.assertRaises(NotImplementedError, lambda: box.has_key('')) + self.assertRaises(NotImplementedError, lambda: '' in box) self.assertRaises(NotImplementedError, lambda: box.__contains__('')) self.assertRaises(NotImplementedError, lambda: box.__len__()) self.assertRaises(NotImplementedError, lambda: box.clear()) |