diff options
author | Anh Tran <anhtt@vn.fujitsu.com> | 2016-10-03 09:35:59 +0700 |
---|---|---|
committer | Anh Tran <anhtt@vn.fujitsu.com> | 2016-10-03 09:35:59 +0700 |
commit | a71c0d5a30452b7ddcd1bb4fa5dc9dc36028fb0c (patch) | |
tree | 1ebf323923c7df647e89da1b09db81fdec7f02a6 /tests | |
parent | 30e0bf5a4970488bd7396c8ec6246fec71d064d4 (diff) | |
download | python-swiftclient-a71c0d5a30452b7ddcd1bb4fa5dc9dc36028fb0c.tar.gz |
Replace assertTrue(a in b) with assertIn(a, b)
Change-Id: I9726c9c051eea9264200ab27b3e556c68d5c927f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_shell.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py index 33e297d..718615d 100644 --- a/tests/unit/test_shell.py +++ b/tests/unit/test_shell.py @@ -2138,7 +2138,7 @@ class TestKeystoneOptions(MockHttpTest): 'Expected %s for key %s, found %s' % (expected, key, actual_args[key])) for flag in flags: - self.assertTrue(flag in actual_args) + self.assertIn(flag, actual_args) self.assertTrue(actual_args[flag]) check_attr = True @@ -2647,7 +2647,7 @@ class TestCrossAccountObjectAccess(TestBase, MockHttpTest): self.assert_request(('PUT', segment_path_0)) self.assert_request(('PUT', segment_path_1)) self.assert_request(('PUT', self.obj_path)) - self.assertTrue(self.obj[1:] in out.out) + self.assertIn(self.obj[1:], out.out) expected_err = "Warning: failed to create container '%s': 403 Fake" \ % self.cont self.assertEqual(expected_err, out.err.strip()) @@ -2693,7 +2693,7 @@ class TestCrossAccountObjectAccess(TestBase, MockHttpTest): self.assert_request(('PUT', segment_path_0)) self.assert_request(('PUT', segment_path_1)) self.assert_request(('PUT', self.obj_path)) - self.assertTrue(self.obj[1:] in out.out) + self.assertIn(self.obj[1:], out.out) expected_err = ("Warning: failed to create container '%s': 403 Fake\n" "Warning: failed to create container '%s': 403 Fake" ) % (self.cont, self.cont + '_segments') @@ -2719,7 +2719,7 @@ class TestCrossAccountObjectAccess(TestBase, MockHttpTest): ('PUT', self.obj_path)]) expected_err = 'Object PUT failed: http://1.2.3.4%s 403 Fake' \ % self.obj_path - self.assertTrue(expected_err in out.err) + self.assertIn(expected_err, out.err) self.assertEqual('', out) @mock.patch.object(swiftclient.service.SwiftService, '_should_bulk_delete', |