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

Function test_derive_from_file_invalid

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

Test deriving SourceInfoSchema from invalid file raises error.

()

Source from the content-addressed store, hash-verified

53
54
55def test_derive_from_file_invalid() -> None:
56 """Test deriving SourceInfoSchema from invalid file raises error."""
57 with tempfile.NamedTemporaryFile(mode="w", suffix=".SRCINFO", delete=True) as tmp:
58 tmp.write("not a valid srcinfo")
59 tmp.flush()
60
61 with pytest.raises(SourceInfoError):
62 SourceInfoSchema.derive_from_file(tmp.name)
63
64
65def test_derive_from_nonexistent_file() -> None:

Callers

nothing calls this directly

Calls 3

writeMethod · 0.80
flushMethod · 0.80
derive_from_fileMethod · 0.45

Tested by

no test coverage detected