def test_invoke_dangling_tool(self): dangling_tool_command = ShellCommand("{tool} fun", tool="wolfyp") self.assertFalse(dangling_tool_command.invoke())
def test_invoke_non_exist_input(self): non_exist_input_cmd = ShellCommand("cat < {input}", input="non_exist_file") self.assertFalse(non_exist_input_cmd.invoke())
def test_invoke_non_exist_output(self): non_exist_output_cmd = ShellCommand("echo tempfile3", output="tempfile3") self.assertFalse(non_exist_output_cmd.invoke())
def test_invoke_collect_output(self): echo_cmd = ShellCommand("echo test_collect").set_stdout_collecting() self.assertTrue(echo_cmd.invoke()) self.assertEqual(echo_cmd.result, "test_collect\n")