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

Function test_from_file_path_object

python-alpm/tests/srcinfo/test_source_info.py:81–91  ·  view source on GitHub ↗

Test parsing SRCINFO from file using Path object.

(
    full_version: FullVersion, valid_srcinfo_content: str
)

Source from the content-addressed store, hash-verified

79
80
81def test_from_file_path_object(
82 full_version: FullVersion, valid_srcinfo_content: str
83) -> None:
84 """Test parsing SRCINFO from file using Path object."""
85 with tempfile.NamedTemporaryFile(mode="w", suffix=".SRCINFO", delete=True) as tmp:
86 tmp.write(valid_srcinfo_content)
87 tmp.flush()
88
89 result = source_info_from_file(Path(tmp.name))
90 assert type(result) is SourceInfoV1
91 assert result.base.version == full_version
92
93
94@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

source_info_from_fileFunction · 0.85
PathEnum · 0.85
writeMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected