MCPcopy Index your code
hub / github.com/bugy/script-server / test_pass_as

Method test_pass_as

src/tests/executor_test.py:145–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 {'PARAM_ID': '918273', 'PARAM_VERBOSE': 'true', 'EXECUTION_ID': '123'})
144
145 def test_pass_as(self):
146 config = create_config_model(
147 'config_x',
148 script_command='bash -c \'sleep 0.1 && echo ">$0< >$1< >$PARAM_P1< >$PARAM_P2< >$PARAM_P3<"\'',
149 parameters=[
150 create_script_param_config('p1', pass_as='argument'),
151 create_script_param_config('p2', pass_as='env_variable'),
152 create_script_param_config('p3', pass_as='stdin'),
153 ],
154 parameter_values={'p1': 'abc', 'p2': 'def', 'p3': 'xyz'})
155
156 executor._process_creator = create_process_wrapper
157 self.create_executor(config)
158 self.executor.start(123)
159
160 data = read_until_closed(self.executor.get_raw_output_stream(), 200)
161 output = ''.join(data)
162
163 self.assertEqual('xyz\n>abc< >< >< >def< ><\n', output)
164
165 def test_pass_as_stdin(self):
166 file_path = test_utils.create_file('my_script.sh', text=''&#x27;

Callers

nothing calls this directly

Calls 6

create_executorMethod · 0.95
create_config_modelFunction · 0.90
read_until_closedFunction · 0.90
startMethod · 0.45
get_raw_output_streamMethod · 0.45

Tested by

no test coverage detected