Test parsing SRCINFO from file with explicit schema.
(
full_version: FullVersion,
valid_srcinfo_content: str,
schema: SourceInfoSchema | None,
)
| 64 | |
| 65 | @pytest.mark.parametrize("schema", [None, SourceInfoSchema("1")]) |
| 66 | def test_from_file_valid( |
| 67 | full_version: FullVersion, |
| 68 | valid_srcinfo_content: str, |
| 69 | schema: SourceInfoSchema | None, |
| 70 | ) -> None: |
| 71 | """Test parsing SRCINFO from file with explicit schema.""" |
| 72 | with tempfile.NamedTemporaryFile(mode="w", suffix=".SRCINFO", delete=True) as tmp: |
| 73 | tmp.write(valid_srcinfo_content) |
| 74 | tmp.flush() |
| 75 | |
| 76 | result = source_info_from_file(tmp.name, schema) |
| 77 | assert type(result) is SourceInfoV1 |
| 78 | assert result.base.version == full_version |
| 79 | |
| 80 | |
| 81 | def test_from_file_path_object( |
nothing calls this directly
no test coverage detected