-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathtest_list2need_list_options.py
More file actions
40 lines (33 loc) · 1.15 KB
/
test_list2need_list_options.py
File metadata and controls
40 lines (33 loc) · 1.15 KB
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
30
31
32
33
34
35
36
37
38
39
40
import json
from pathlib import Path
import pytest
@pytest.mark.parametrize(
"test_app",
[
{
"buildername": "needs",
"srcdir": "doc_test/doc_list2need_list_options",
"confoverrides": {"needs_reproducible_json": True},
}
],
indirect=True,
)
def test_doc_list2need_list_options(test_app, snapshot):
app = test_app
app.build()
needs_list = json.loads(Path(app.outdir, "needs.json").read_text())
needs = needs_list["versions"][""]["needs"]
# Check that all entries have a status item equal to "open"
for need_id, need in needs.items():
assert need.get("status") == "open", (
f"Need {need_id} does not have status 'open'"
)
assert "SomeValue" in need.get("aggregateoption", ""), (
f"Need {need_id} does not have 'SomeValue' in aggregateoption"
)
# Check that NEED-D has "OtherValue" in its aggregateoption
need_d = needs.get("NEED-D")
assert need_d is not None, "NEED-D is missing"
assert "OtherValue" in need_d.get("aggregateoption", ""), (
"NEED-D does not have 'OtherValue' in aggregateoption"
)