forked from osbuild/osbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 |