diff --git a/pytest_abra/coordinator.py b/pytest_abra/coordinator.py index 2ec3182..a8dc94f 100644 --- a/pytest_abra/coordinator.py +++ b/pytest_abra/coordinator.py @@ -37,7 +37,7 @@ class Coordinator: logger.info("calling prepare_tests()") self.DIR.create_all_dirs() self.ENV.copy_env_files(self.DIR) - self.load_test_credentials() + self.load_test_credentials(self.DIR) def run_tests(self) -> None: logger.info("calling run_tests()") @@ -88,14 +88,15 @@ class Coordinator: f.parent.rename(new_path) rmtree(trace_root_dir) - def load_test_credentials(self): + @staticmethod + def load_test_credentials(DIR: DirManager): """Load test user credentials. If not available, create them randomly. Test users are created during testing but should be deleted after the test. In case test users are not deleted after tests by accident, the user credentials are not known to an attacker.""" - test_credentials_path = self.DIR.STATES / "credentials_test.json" + test_credentials_path = DIR.STATES / "credentials_test.json" if not test_credentials_path.is_file(): test_credentials = { "TEST_USER": "test-" + generate_random_string(6),