Skip to content

Commit 6cb7626

Browse files
committed
Specify all flags in report file integration test
Previously, the test relied on the defaults, meaning it broke if they were changed. The purpose of this test is only to test the generation and format of the report, so checking defaults is out of scope.
1 parent edcf04a commit 6cb7626

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

test/test_all.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,36 @@ def test_recursive_invalid(run_command):
129129

130130
def test_report_file(run_command, working_dir):
131131
project_path = test_data_path.joinpath("ValidSketch")
132+
compliance = "permissive"
133+
library_manager = "update"
134+
project_type = "sketch"
132135
report_file_name = "report.json"
133-
result = run_command(cmd=["--report-file", report_file_name, project_path])
136+
result = run_command(
137+
cmd=[
138+
"--compliance",
139+
compliance,
140+
"--library-manager",
141+
library_manager,
142+
"--project-type",
143+
project_type,
144+
"--recursive",
145+
"true",
146+
"--report-file",
147+
report_file_name,
148+
project_path,
149+
]
150+
)
134151
assert result.ok
135152
with pathlib.Path(working_dir, report_file_name).open() as report_file:
136153
report = json.load(report_file)
137154

138155
assert pathlib.PurePath(report["configuration"]["paths"][0]) == project_path
139-
assert report["configuration"]["projectType"] == "all"
156+
assert report["configuration"]["projectType"] == project_type
140157
assert report["configuration"]["recursive"]
141158
assert pathlib.PurePath(report["projects"][0]["path"]) == project_path
142159
assert report["projects"][0]["projectType"] == "sketch"
160+
assert report["projects"][0]["configuration"]["compliance"] == compliance
161+
assert report["projects"][0]["configuration"]["libraryManager"] == library_manager
143162
assert report["projects"][0]["summary"]["pass"]
144163
assert report["projects"][0]["summary"]["errorCount"] == 0
145164
assert report["summary"]["pass"]

0 commit comments

Comments
 (0)