diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-23 23:04:36 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-23 23:04:36 (GMT) |
| commit | aa98058cc44ba20f35c106d20918c6196b737561 (patch) | |
| tree | 317b6f7bf17df98e284d0902ae10a64faf4ccd91 /Lib/test/test_bsddb.py | |
| parent | 8cd0a66a0fd7bb7d69153906942930c2e8c3dd17 (diff) | |
| download | cpython-aa98058cc44ba20f35c106d20918c6196b737561.zip cpython-aa98058cc44ba20f35c106d20918c6196b737561.tar.gz cpython-aa98058cc44ba20f35c106d20918c6196b737561.tar.bz2 | |
use assert[Not]In where appropriate
Diffstat (limited to 'Lib/test/test_bsddb.py')
| -rwxr-xr-x | Lib/test/test_bsddb.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_bsddb.py b/Lib/test/test_bsddb.py index a4af0f3..5dda50c 100755 --- a/Lib/test/test_bsddb.py +++ b/Lib/test/test_bsddb.py @@ -43,8 +43,8 @@ class TestBSDDB(unittest.TestCase): def test_change(self): self.f['r'] = 'discovered' self.assertEqual(self.f['r'], 'discovered') - self.assertTrue('r' in self.f.keys()) - self.assertTrue('discovered' in self.f.values()) + self.assertIn('r', self.f.keys()) + self.assertIn('discovered', self.f.values()) def test_close_and_reopen(self): if self.fname is None: @@ -195,8 +195,8 @@ class TestBSDDB(unittest.TestCase): def test_contains(self): for k in self.d: - self.assertTrue(k in self.f) - self.assertTrue('not here' not in self.f) + self.assertIn(k, self.f) + self.assertNotIn('not here', self.f) def test_has_key(self): for k in self.d: @@ -253,9 +253,9 @@ class TestBSDDB(unittest.TestCase): if debug: print "K" # test the legacy cursor interface mixed with writes - self.assertTrue(self.f.first()[0] in self.d) + self.assertIn(self.f.first()[0], self.d) k = self.f.next()[0] - self.assertTrue(k in self.d) + self.assertIn(k, self.d) self.f[k] = "be gone with ye deadlocks" self.assertTrue(self.f[k], "be gone with ye deadlocks") @@ -279,17 +279,17 @@ class TestBSDDB(unittest.TestCase): def test_popitem(self): k, v = self.f.popitem() - self.assertTrue(k in self.d) - self.assertTrue(v in self.d.values()) - self.assertTrue(k not in self.f) + self.assertIn(k, self.d) + self.assertIn(v, self.d.values()) + self.assertNotIn(k, self.f) self.assertEqual(len(self.d)-1, len(self.f)) def test_pop(self): k = 'w' v = self.f.pop(k) self.assertEqual(v, self.d[k]) - self.assertTrue(k not in self.f) - self.assertTrue(v not in self.f.values()) + self.assertNotIn(k, self.f) + self.assertNotIn(v, self.f.values()) self.assertEqual(len(self.d)-1, len(self.f)) def test_get(self): |
