Commit e49b6557 authored by Lucas Felix's avatar Lucas Felix
Browse files

Test error message from broken session yaml

parent 4cba9bf8
Pipeline #75542 passed with stages
in 107 minutes and 59 seconds
......@@ -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]],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment