MCPcopy Create free account
hub / github.com/apple/axlearn / test_invoke_basic

Method test_invoke_basic

axlearn/cli/utils_test.py:104–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

102 )
103
104 def test_invoke_basic(self):
105 # Test invoking a command.
106 args = _parse(
107 [
108 self.root_module,
109 "child1",
110 "grandchild1",
111 "command1",
112 "--required=test1",
113 "--optional=test2",
114 ]
115 )
116 self.assertEqual(
117 args.argv,
118 [
119 self.root_module,
120 "--required=test1",
121 "--optional=test2",
122 "--undefok=root,root_default,child1",
123 "--root_default=some_value",
124 ],
125 )
126 returncode, stdout, _ = _run(args)
127 self.assertEqual(returncode, 0)
128 self.assertEqual(stdout, "required: test1, optional: test2, root_default: some_value")
129
130 def test_invoke_required(self):
131 # Test invoking a command without a required flag.

Callers

nothing calls this directly

Calls 2

_parseFunction · 0.85
_runFunction · 0.70

Tested by

no test coverage detected