MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_process_remote_default

Function test_process_remote_default

tests/unit/test_main.py:182–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181
182def test_process_remote_default():
183 # GIVEN
184
185 argv = ["pystack", "remote", "31"]
186
187 threads = [Mock(), Mock(), Mock()]
188
189 # WHEN
190
191 with patch(
192 "pystack.__main__.get_process_threads"
193 ) as get_process_threads_mock, patch(
194 "pystack.__main__.print_thread"
195 ) as print_thread_mock, patch(
196 "sys.argv", argv
197 ):
198 get_process_threads_mock.return_value = threads
199 main()
200
201 # THEN
202
203 get_process_threads_mock.assert_called_with(
204 31,
205 stop_process=True,
206 native_mode=NativeReportingMode.OFF,
207 locals=False,
208 method=StackMethod.AUTO,
209 )
210 assert print_thread_mock.mock_calls == [
211 call(thread, NativeReportingMode.OFF) for thread in threads
212 ]
213
214
215def test_process_remote_no_block():

Callers

nothing calls this directly

Calls 1

mainFunction · 0.90

Tested by

no test coverage detected