MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / test_evaluate_name_mangling

Function test_evaluate_name_mangling

tests_python/test_debugger_json.py:2310–2344  ·  view source on GitHub ↗
(case_setup_dap, pyfile)

Source from the content-addressed store, hash-verified

2308
2309
2310def test_evaluate_name_mangling(case_setup_dap, pyfile):
2311
2312 @pyfile
2313 def target():
2314
2315 class SomeObj(object):
2316
2317 def __init__(self):
2318 self.__value = 10
2319 print("here") # Break here
2320
2321 SomeObj()
2322
2323 print("TEST SUCEEDED")
2324
2325 with case_setup_dap.test_file(target) as writer:
2326 json_facade = JsonFacade(writer)
2327
2328 writer.write_add_breakpoint(writer.get_line_index_with_content("Break here"))
2329 json_facade.write_launch(justMyCode=False)
2330 json_facade.write_make_initial_run()
2331
2332 json_hit = json_facade.wait_for_thread_stopped()
2333 json_hit = json_facade.get_stack_as_json_hit(json_hit.thread_id)
2334
2335 # Check eval with a properly indented block
2336 evaluate_response = json_facade.evaluate(
2337 "self.__value",
2338 frameId=json_hit.frame_id,
2339 context="repl",
2340 )
2341
2342 assert evaluate_response.body.result == "10"
2343 json_facade.write_continue()
2344 writer.finished_ok = True
2345
2346
2347def test_evaluate_no_name_mangling(case_setup_dap):

Callers

nothing calls this directly

Calls 10

write_launchMethod · 0.95
get_stack_as_json_hitMethod · 0.95
evaluateMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80
write_add_breakpointMethod · 0.80

Tested by

no test coverage detected