[TrivialFix] Replace 'assertTrue(a in b)' with 'assertIn(a, b)'
Change-Id: Ib61f2f2c695f79c8eb0fa47a2d2d1bc66ccaeb7f
This commit is contained in:
parent
9f1c2f01f0
commit
393e74653b
@ -125,23 +125,23 @@ class ProcessExecutionErrorTest(test_base.BaseTestCase):
|
|||||||
|
|
||||||
def test_defaults(self):
|
def test_defaults(self):
|
||||||
err = processutils.ProcessExecutionError()
|
err = processutils.ProcessExecutionError()
|
||||||
self.assertTrue('None\n' in six.text_type(err))
|
self.assertIn('None\n', six.text_type(err))
|
||||||
self.assertTrue('code: -\n' in six.text_type(err))
|
self.assertIn('code: -\n', six.text_type(err))
|
||||||
|
|
||||||
def test_with_description(self):
|
def test_with_description(self):
|
||||||
description = 'The Narwhal Bacons at Midnight'
|
description = 'The Narwhal Bacons at Midnight'
|
||||||
err = processutils.ProcessExecutionError(description=description)
|
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):
|
def test_with_exit_code(self):
|
||||||
exit_code = 0
|
exit_code = 0
|
||||||
err = processutils.ProcessExecutionError(exit_code=exit_code)
|
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):
|
def test_with_cmd(self):
|
||||||
cmd = 'telinit'
|
cmd = 'telinit'
|
||||||
err = processutils.ProcessExecutionError(cmd=cmd)
|
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):
|
def test_with_stdout(self):
|
||||||
stdout = """
|
stdout = """
|
||||||
@ -165,12 +165,12 @@ class ProcessExecutionErrorTest(test_base.BaseTestCase):
|
|||||||
""".strip()
|
""".strip()
|
||||||
err = processutils.ProcessExecutionError(stdout=stdout)
|
err = processutils.ProcessExecutionError(stdout=stdout)
|
||||||
print(six.text_type(err))
|
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):
|
def test_with_stderr(self):
|
||||||
stderr = 'Cottonian library'
|
stderr = 'Cottonian library'
|
||||||
err = processutils.ProcessExecutionError(stderr=stderr)
|
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):
|
def test_retry_on_failure(self):
|
||||||
fd, tmpfilename = tempfile.mkstemp()
|
fd, tmpfilename = tempfile.mkstemp()
|
||||||
|
Loading…
Reference in New Issue
Block a user