Update tests/test_utils_elog.py
Run CI Tests / test (push) Successful in 2m31s

This commit is contained in:
2025-08-29 10:57:06 +02:00
parent 18c0d43d2b
commit 2062a697f9
+2 -7
View File
@@ -42,8 +42,8 @@ def test_get_default_elog_instance_with_wrong_password_and_real_check():
@patch("slic.utils.elog.getpass")
@patch("slic.utils.elog.Path.home")
def test_get_default_elog_instance_asks_password_and_opens(mock_home, mock_getpass):
mock_home.return_value = Path("/does/not/exist") # Fausse home → lecture échoue
def test_get_default_elog_instance_asks_password(mock_home, mock_getpass):
mock_home.return_value = Path("/does/not/exist")
mock_getpass.return_value = "testpassword"
user = "robot"
text = "This is a message2"
@@ -56,11 +56,6 @@ def test_get_default_elog_instance_asks_password_and_opens(mock_home, mock_getpa
except Exception as e:
pytest.fail(f"elog.post() raised an unexpected exception: {e}")
try:
msg_id = elog.post(text)
except Exception as e:
pytest.fail(f"elog.post() raised an unexpected exception: {e}")
message, attributes, attachments = elog.read(msg_id)
assert text in message