|
26 | 26 |
|
27 | 27 |
|
28 | 28 | def test_defaults(run_command):
|
29 |
| - result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("recursive")) |
| 29 | + result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("ValidSketch")) |
30 | 30 | assert result.ok
|
31 | 31 |
|
| 32 | + result = run_command(cmd=[], custom_working_dir=test_data_path.joinpath("recursive")) |
| 33 | + assert not result.ok |
| 34 | + |
32 | 35 |
|
33 | 36 | @pytest.mark.parametrize(
|
34 | 37 | "project_folder, compliance_level",
|
@@ -115,31 +118,44 @@ def test_project_type_invalid(run_command):
|
115 | 118 |
|
116 | 119 | def test_recursive(run_command):
|
117 | 120 | valid_projects_path = test_data_path.joinpath("recursive")
|
118 |
| - result = run_command(cmd=["--recursive", "true", valid_projects_path]) |
119 |
| - assert result.ok |
120 |
| - |
121 |
| - result = run_command(cmd=["--recursive", "false", valid_projects_path]) |
| 121 | + result = run_command(cmd=[valid_projects_path]) |
122 | 122 | assert not result.ok
|
123 | 123 |
|
124 |
| - |
125 |
| -def test_recursive_invalid(run_command): |
126 |
| - result = run_command(cmd=["--recursive", "foo", test_data_path.joinpath("ValidSketch")]) |
127 |
| - assert not result.ok |
| 124 | + result = run_command(cmd=["--recursive", valid_projects_path]) |
| 125 | + assert result.ok |
128 | 126 |
|
129 | 127 |
|
130 | 128 | def test_report_file(run_command, working_dir):
|
131 | 129 | project_path = test_data_path.joinpath("ValidSketch")
|
| 130 | + compliance = "permissive" |
| 131 | + library_manager = "update" |
| 132 | + project_type = "sketch" |
132 | 133 | report_file_name = "report.json"
|
133 |
| - result = run_command(cmd=["--report-file", report_file_name, project_path]) |
| 134 | + result = run_command( |
| 135 | + cmd=[ |
| 136 | + "--compliance", |
| 137 | + compliance, |
| 138 | + "--library-manager", |
| 139 | + library_manager, |
| 140 | + "--project-type", |
| 141 | + project_type, |
| 142 | + "--recursive", |
| 143 | + "--report-file", |
| 144 | + report_file_name, |
| 145 | + project_path, |
| 146 | + ] |
| 147 | + ) |
134 | 148 | assert result.ok
|
135 | 149 | with pathlib.Path(working_dir, report_file_name).open() as report_file:
|
136 | 150 | report = json.load(report_file)
|
137 | 151 |
|
138 | 152 | assert pathlib.PurePath(report["configuration"]["paths"][0]) == project_path
|
139 |
| - assert report["configuration"]["projectType"] == "all" |
| 153 | + assert report["configuration"]["projectType"] == project_type |
140 | 154 | assert report["configuration"]["recursive"]
|
141 | 155 | assert pathlib.PurePath(report["projects"][0]["path"]) == project_path
|
142 | 156 | assert report["projects"][0]["projectType"] == "sketch"
|
| 157 | + assert report["projects"][0]["configuration"]["compliance"] == compliance |
| 158 | + assert report["projects"][0]["configuration"]["libraryManager"] == library_manager |
143 | 159 | assert report["projects"][0]["summary"]["pass"]
|
144 | 160 | assert report["projects"][0]["summary"]["errorCount"] == 0
|
145 | 161 | assert report["summary"]["pass"]
|
@@ -187,7 +203,7 @@ def test_version(run_command):
|
187 | 203 |
|
188 | 204 |
|
189 | 205 | def test_arduino_lint_official(run_command):
|
190 |
| - project_path = test_data_path.joinpath("ARDUINO_LINT_OFFICIAL") |
| 206 | + project_path = test_data_path.joinpath("ARDUINO_LINT_OFFICIAL", "Arduino_Lib") |
191 | 207 |
|
192 | 208 | result = run_command(cmd=[project_path])
|
193 | 209 | assert not result.ok
|
|
0 commit comments