(case_setup_dap)
| 1921 | |
| 1922 | |
| 1923 | def test_dict_ordered(case_setup_dap): |
| 1924 | with case_setup_dap.test_file("_debugger_case_odict.py") as writer: |
| 1925 | json_facade = JsonFacade(writer) |
| 1926 | |
| 1927 | json_facade.write_set_breakpoints(writer.get_line_index_with_content("break here")) |
| 1928 | json_facade.write_make_initial_run() |
| 1929 | |
| 1930 | json_hit = json_facade.wait_for_thread_stopped() |
| 1931 | json_hit = json_facade.get_stack_as_json_hit(json_hit.thread_id) |
| 1932 | |
| 1933 | variables_response = json_facade.get_variables_response(json_hit.frame_id) |
| 1934 | |
| 1935 | variables_references = variables_response.body.variables |
| 1936 | for dct in variables_references: |
| 1937 | if dct["name"] == "odict": |
| 1938 | break |
| 1939 | else: |
| 1940 | raise AssertionError('Expected to find "odict".') |
| 1941 | ref = dct["variablesReference"] |
| 1942 | |
| 1943 | assert isinstance(ref, int_types) |
| 1944 | # : :type variables_response: VariablesResponse |
| 1945 | |
| 1946 | variables_response = json_facade.get_variables_response(ref) |
| 1947 | assert [ |
| 1948 | (d["name"], d["value"]) |
| 1949 | for d in variables_response.body.variables |
| 1950 | if (not d["name"].startswith("_OrderedDict")) and (d["name"] not in DAPGrouper.SCOPES_SORTED) |
| 1951 | ] == [("4", "'first'"), ("3", "'second'"), ("2", "'last'"), (GENERATED_LEN_ATTR_NAME, "3")] |
| 1952 | |
| 1953 | json_facade.write_continue() |
| 1954 | writer.finished_ok = True |
| 1955 | |
| 1956 | |
| 1957 | def test_dict_contents(case_setup_dap, pyfile): |
nothing calls this directly
no test coverage detected