From 2b8ba3f9c495f6d3bad63aa26946c6120966b5b7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 11 Dec 2023 13:59:53 +0100 Subject: [PATCH] make load_test_credentials a staticmethod --- pytest_abra/coordinator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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),