Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
e49b6557
Commit
e49b6557
authored
May 23, 2022
by
Lucas Felix
Browse files
Test error message from broken session yaml
parent
4cba9bf8
Pipeline
#75542
passed with stages
in 107 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/config/test_config.py
View file @
e49b6557
...
...
@@ -10,6 +10,7 @@ import os
from
unittest.mock
import
patch
import
pytest
import
ruamel
import
subprocess
from
bliss.config.conductor
import
client
from
bliss.config.static
import
ConfigNode
...
...
@@ -162,6 +163,26 @@ def test_ruamel_load_error(beacon, beacon_directory):
assert
error_msg
.
startswith
(
"YAML parser failure:"
)
def
test_broken_session_yml
(
beacon
,
beacon_directory
):
broken_session
=
f
"
{
beacon_directory
}
/broken_session.yml"
with
open
(
broken_session
,
"w"
)
as
f
:
f
.
write
(
"foo"
)
bliss_shell
=
subprocess
.
Popen
(
[
sys
.
executable
,
"-m"
,
"bliss.shell.main"
,
"-s"
,
"broken_session"
],
stdout
=
subprocess
.
PIPE
,
)
output
,
err
=
bliss_shell
.
communicate
()
expected
=
"'broken_session' does not seem to be a valid session, "
expected
+=
"it may relate to the following yaml error(s):
\n
"
expected
+=
"Ignored 1 YAML file(s) due to parsing error(s):
\n
"
expected
+=
" - broken_session.yml:
\n
"
expected
+=
" |'str' object has no attribute 'items'
\n
"
assert
expected
in
output
.
decode
()
@
pytest
.
mark
.
parametrize
(
"object_name, get_func_name, copy"
,
[[
"refs_test"
,
"get"
,
False
],
[
"refs_test_cpy"
,
"get_config"
,
True
]],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment