Commit 7fcf849f authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a small unittext extension for utils.RunCmd

Reviewed-by: imsnah
parent 9df6d173
......@@ -136,6 +136,19 @@ class TestRunCmd(unittest.TestCase):
result = RunCmd("/bin/sh -c 'kill -15 $$'")
self.assertEqual(result.signal, 15)
def testListRun(self):
"""Test list runs"""
result = RunCmd(["true"])
self.assertEqual(result.signal, None)
self.assertEqual(result.exit_code, 0)
result = RunCmd(["/bin/sh", "-c", "exit 1"])
self.assertEqual(result.signal, None)
self.assertEqual(result.exit_code, 1)
result = RunCmd(["echo", "-n", self.magic])
self.assertEqual(result.signal, None)
self.assertEqual(result.exit_code, 0)
self.assertEqual(result.stdout, self.magic)
class TestRemoveFile(unittest.TestCase):
"""Test case for the RemoveFile function"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment