MCPcopy
hub / github.com/cookiecutter/cookiecutter / test_process_json_deep_dict

Function test_process_json_deep_dict

tests/test_read_user_dict.py:39–72  ·  view source on GitHub ↗

Test `process_json` for correct output on JSON input. Test for dict in dict case.

()

Source from the content-addressed store, hash-verified

37
38
39def test_process_json_deep_dict() -> None:
40 """Test `process_json` for correct output on JSON input.
41
42 Test for dict in dict case.
43 """
44 user_value = """{
45 "key": "value",
46 "integer_key": 37,
47 "dict_key": {
48 "deep_key": "deep_value",
49 "deep_integer": 42,
50 "deep_list": [
51 "deep value 1",
52 "deep value 2",
53 "deep value 3"
54 ]
55 },
56 "list_key": [
57 "value 1",
58 "value 2",
59 "value 3"
60 ]
61 }"""
62
63 assert process_json(user_value) == {
64 "key": "value",
65 "integer_key": 37,
66 "dict_key": {
67 "deep_key": "deep_value",
68 "deep_integer": 42,
69 "deep_list": ["deep value 1", "deep value 2", "deep value 3"],
70 },
71 "list_key": ["value 1", "value 2", "value 3"],
72 }
73
74
75def test_should_raise_type_error(mocker) -> None:

Callers

nothing calls this directly

Calls 1

process_jsonFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…