diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-10-25 16:32:42 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-10-25 16:32:42 +0000 |
commit | 7066039a1b9b57cb2336dab8233b25972be09744 (patch) | |
tree | 05420bde7fedfaca7f24f2998426c68416aa6f05 | |
parent | 0d8c71a9c34dbd2c849a0bf348e28aaf56e94772 (diff) | |
parent | 393e74653ba6072480f2227c9b68573342dd0b88 (diff) | |
download | oslo-concurrency-7066039a1b9b57cb2336dab8233b25972be09744.tar.gz |
Merge "[TrivialFix] Replace 'assertTrue(a in b)' with 'assertIn(a, b)'"
-rw-r--r-- | oslo_concurrency/tests/unit/test_processutils.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/oslo_concurrency/tests/unit/test_processutils.py b/oslo_concurrency/tests/unit/test_processutils.py index e5ef532..9227ea1 100644 --- a/oslo_concurrency/tests/unit/test_processutils.py +++ b/oslo_concurrency/tests/unit/test_processutils.py @@ -125,23 +125,23 @@ class ProcessExecutionErrorTest(test_base.BaseTestCase): def test_defaults(self): err = processutils.ProcessExecutionError() - self.assertTrue('None\n' in six.text_type(err)) - self.assertTrue('code: -\n' in six.text_type(err)) + self.assertIn('None\n', six.text_type(err)) + self.assertIn('code: -\n', six.text_type(err)) def test_with_description(self): description = 'The Narwhal Bacons at Midnight' err = processutils.ProcessExecutionError(description=description) - self.assertTrue(description in six.text_type(err)) + self.assertIn(description, six.text_type(err)) def test_with_exit_code(self): exit_code = 0 err = processutils.ProcessExecutionError(exit_code=exit_code) - self.assertTrue(str(exit_code) in six.text_type(err)) + self.assertIn(str(exit_code), six.text_type(err)) def test_with_cmd(self): cmd = 'telinit' err = processutils.ProcessExecutionError(cmd=cmd) - self.assertTrue(cmd in six.text_type(err)) + self.assertIn(cmd, six.text_type(err)) def test_with_stdout(self): stdout = """ @@ -165,12 +165,12 @@ class ProcessExecutionErrorTest(test_base.BaseTestCase): """.strip() err = processutils.ProcessExecutionError(stdout=stdout) print(six.text_type(err)) - self.assertTrue('people-kings' in six.text_type(err)) + self.assertIn('people-kings', six.text_type(err)) def test_with_stderr(self): stderr = 'Cottonian library' err = processutils.ProcessExecutionError(stderr=stderr) - self.assertTrue(stderr in six.text_type(err)) + self.assertIn(stderr, six.text_type(err)) def test_retry_on_failure(self): fd, tmpfilename = tempfile.mkstemp() |