-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_json.py
More file actions
29 lines (23 loc) · 815 Bytes
/
test_json.py
File metadata and controls
29 lines (23 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).
from unittest import TestCase
from xrlint.formatters.json import Json
from .helpers import get_context, get_test_results
class JsonTest(TestCase):
def test_json(self):
results = get_test_results()
formatter = Json()
text = formatter.format(
context=get_context(),
results=results,
)
self.assertIn('"results": [', text)
def test_json_with_meta(self):
results = get_test_results()
formatter = Json(with_meta=True)
text = formatter.format(
context=get_context(),
results=results,
)
self.assertIn('"results": [', text)