MCPcopy
hub / github.com/Textualize/rich / test_highlight_json_no_indent

Function test_highlight_json_no_indent

tests/test_highlighter.py:203–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201
202
203def test_highlight_json_no_indent():
204 json_string = json.dumps({"name": "apple", "count": 1}, indent=None)
205 text = Text(json_string)
206 highlighter = JSONHighlighter()
207 highlighter.highlight(text)
208 assert text.spans == [
209 Span(0, 1, "json.brace"),
210 Span(1, 7, "json.str"),
211 Span(9, 16, "json.str"),
212 Span(18, 25, "json.str"),
213 Span(27, 28, "json.number"),
214 Span(28, 29, "json.brace"),
215 Span(1, 7, "json.key"),
216 Span(18, 25, "json.key"),
217 ]
218
219
220iso8601_highlight_tests = [

Callers

nothing calls this directly

Calls 4

highlightMethod · 0.95
TextClass · 0.90
JSONHighlighterClass · 0.90
SpanClass · 0.90

Tested by

no test coverage detected