MCPcopy
hub / github.com/eudicots/Cactus / run_cli

Method run_cli

cactus/tests/test_cli.py:49–65  ·  view source on GitHub ↗
(self, args, stdin="", cwd=None)

Source from the content-addressed store, hash-verified

47 self.fail("Unable to find Cactus")
48
49 def run_cli(self, args, stdin="", cwd=None):
50 real_args = [self.find_cactus()]
51 real_args.extend(args)
52
53 kwargs = {
54 "args": real_args,
55 "stdin": subprocess.PIPE,
56 "stdout": subprocess.PIPE,
57 "stderr": subprocess.PIPE,
58 }
59
60 if cwd is not None:
61 kwargs["cwd"] = cwd
62
63 p = subprocess.Popen(**kwargs)
64 out, err = p.communicate(stdin.encode("utf-8"))
65 return p.returncode, out.decode("utf-8"), err.decode("utf-8")
66
67 def test_create_and_build(self):
68 self.assertEqual(0, len(os.listdir(self.test_dir)))

Callers 4

test_create_and_buildMethod · 0.95
test_custom_pathMethod · 0.95
test_helpMethod · 0.95
test_serveMethod · 0.95

Calls 1

find_cactusMethod · 0.95

Tested by

no test coverage detected