MCPcopy Create free account
hub / github.com/archlinux/alpm / test_derive_from_file

Function test_derive_from_file

python-alpm/tests/srcinfo/test_schema.py:35–42  ·  view source on GitHub ↗

Test deriving SourceInfoSchema from SRCINFO file.

(valid_srcinfo_content: str)

Source from the content-addressed store, hash-verified

33
34
35def test_derive_from_file(valid_srcinfo_content: str) -> None:
36 """Test deriving SourceInfoSchema from SRCINFO file."""
37 with tempfile.NamedTemporaryFile(mode="w", suffix=".SRCINFO", delete=True) as tmp:
38 tmp.write(valid_srcinfo_content)
39 tmp.flush()
40
41 schema = SourceInfoSchema.derive_from_file(Path(tmp.name))
42 assert str(schema.version) == "1.0.0"
43
44
45def test_derive_from_file_string_path(valid_srcinfo_content: str) -> None:

Callers

nothing calls this directly

Calls 4

PathEnum · 0.85
writeMethod · 0.80
flushMethod · 0.80
derive_from_fileMethod · 0.45

Tested by

no test coverage detected