Skip to content
Snippets Groups Projects
Commit 2543a48f authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

test that init command logs as required

parent 83dcb25d
No related branches found
No related tags found
1 merge request!83Create init command
Pipeline #374239 passed
...@@ -1111,7 +1111,7 @@ def initialize_environment(root_dir: Path) -> None: ...@@ -1111,7 +1111,7 @@ def initialize_environment(root_dir: Path) -> None:
# record the msg in the log file # record the msg in the log file
record_script_execution_summary( record_script_execution_summary(
root_dir=root_dir, root_dir=root_dir,
msg=f"Initialising MPSD software instance at {os.getcwd()}.", msg=f"Initialising MPSD software instance at {root_dir}.",
) )
......
...@@ -527,6 +527,10 @@ def test_initialize_environment(tmp_path): ...@@ -527,6 +527,10 @@ def test_initialize_environment(tmp_path):
init_file = tmp_path / mod.config_vars["init_file"] init_file = tmp_path / mod.config_vars["init_file"]
assert init_file.exists() assert init_file.exists()
# ensure "Initialising MPSD software ..." is in the log file
log_file = tmp_path / mod.config_vars["cmd_log_file"]
with open(log_file, "r") as f:
assert (f"Initialising MPSD software instance at {tmp_path}") in f.read()
# test that calling again results in warning and exit code 1 # test that calling again results in warning and exit code 1
with pytest.raises(SystemExit) as pytest_wrapped_e: with pytest.raises(SystemExit) as pytest_wrapped_e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment