debian-forge/test/run/test_main.py
Michael Vogt f3188e841f osbuild: also print what export is availalble when one is not found
The current error message when an export is not found could be
improved by printing what exports are actually availalble to make
it easier for the user to e.g. spot typos.
2024-09-10 10:49:18 -07:00

24 lines
507 B
Python

import json
import pytest
from .. import test
jsondata = json.dumps({
"version": "2",
"pipelines": [
{
"name": "noop",
},
{
"name": "noop2",
},
],
})
def test_exports_are_shown_on_missing_exports(capsys):
with pytest.raises(AssertionError):
with test.OSBuild() as osb:
osb.compile(jsondata, exports=["not-existing"])
assert "Export not-existing not found in ['noop', 'noop2']\n" in capsys.readouterr().out