(
api_spec_dir: str,
api_spec_file: str,
contents: str,
rc: int,
rule_runner: RuleRunner,
)
| 240 | |
| 241 | |
| 242 | def write_validate_files( |
| 243 | api_spec_dir: str, |
| 244 | api_spec_file: str, |
| 245 | contents: str, |
| 246 | rc: int, |
| 247 | rule_runner: RuleRunner, |
| 248 | ) -> None: |
| 249 | files = { |
| 250 | f"{api_spec_dir}/{api_spec_file}": contents, |
| 251 | f"{api_spec_dir}/BUILD": f"api_spec(name='t', source='{api_spec_file}')", |
| 252 | # add in the target that's hard-coded in the generate_api_spec_via_fmt rule |
| 253 | f"{ValidateApiSpec.directory}/{ValidateApiSpec.cmd}.py": VALIDATE_API_SPEC_PY.format( |
| 254 | api_spec_dir=api_spec_dir, rc=rc |
| 255 | ), |
| 256 | f"{ValidateApiSpec.directory}/BUILD": "python_sources()", |
| 257 | ValidateApiSpec.config_file: "", |
| 258 | } |
| 259 | |
| 260 | module = ValidateApiSpec.directory |
| 261 | while module != ValidateApiSpec.source_root: |
| 262 | files[f"{module}/__init__.py"] = "" |
| 263 | module = os.path.dirname(module) |
| 264 | |
| 265 | rule_runner.write_files(files) |
| 266 | |
| 267 | |
| 268 | def test_validate_passed(rule_runner: RuleRunner) -> None: |
no test coverage detected