diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py index 442cc8da22a7d7784a3626689250b05d51a467cd..0803f7b623f1d8aa37a775c115da697f63aa9750 100755 --- a/src/mpsd_software_manager/mpsd_software.py +++ b/src/mpsd_software_manager/mpsd_software.py @@ -1085,7 +1085,7 @@ def environment_status(mpsd_release: str, root_dir: Union[str, Path]) -> dict: return toolchain_map -def initialize_environment(root_dir: Path) -> None: +def initialise_environment(root_dir: Path) -> None: """Initialize the software environment. This creates a hidden file ``.mpsd-software-root`` to tag the location for @@ -1258,7 +1258,7 @@ def main(): # Check if the action is init # if so, call the init function and exit if args.action == "init": - initialize_environment(Path(os.getcwd())) + initialise_environment(Path(os.getcwd())) sys.exit(0) # root_dir is the place where this MPSD software instance has its root diff --git a/tests/test_mpsd_software.py b/tests/test_mpsd_software.py index 1d2a26ef5f68f4161a76d5986b98c688f63f34c0..34c98668b56d1842ecd5d4ee0fff3c88cf7c99d3 100644 --- a/tests/test_mpsd_software.py +++ b/tests/test_mpsd_software.py @@ -520,10 +520,10 @@ def test_remove_environment(tmp_path): # done in test_install_environment_zlib -def test_initialize_environment(tmp_path): +def test_initialise_environment(tmp_path): """Test that init_file is created as expected.""" # test that the init file is created as expected - mod.initialize_environment(tmp_path) + mod.initialise_environment(tmp_path) init_file = tmp_path / mod.config_vars["init_file"] assert init_file.exists() @@ -534,7 +534,7 @@ def test_initialize_environment(tmp_path): # test that calling again results in warning and exit code 30 with pytest.raises(SystemExit) as pytest_wrapped_e: - mod.initialize_environment(tmp_path) + mod.initialise_environment(tmp_path) assert pytest_wrapped_e.type == SystemExit assert pytest_wrapped_e.value.code == 30 @@ -549,7 +549,7 @@ def test_get_root_dir(tmp_path): assert pytest_wrapped_e.value.code == 40 # test that initialize_environment creates the root dir - mod.initialize_environment(tmp_path) + mod.initialise_environment(tmp_path) root_dir = mod.get_root_dir() assert root_dir == tmp_path @@ -562,7 +562,7 @@ def test_get_root_dir(tmp_path): # test that initialising in a subdirectory makes it the root dir with mod.os_chdir(sub_dir): - mod.initialize_environment(sub_dir) + mod.initialise_environment(sub_dir) root_dir = mod.get_root_dir() assert root_dir == sub_dir