make load_test_credentials a staticmethod
This commit is contained in:
parent
106e40920c
commit
2b8ba3f9c4
1 changed files with 4 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ class Coordinator:
|
||||||
logger.info("calling prepare_tests()")
|
logger.info("calling prepare_tests()")
|
||||||
self.DIR.create_all_dirs()
|
self.DIR.create_all_dirs()
|
||||||
self.ENV.copy_env_files(self.DIR)
|
self.ENV.copy_env_files(self.DIR)
|
||||||
self.load_test_credentials()
|
self.load_test_credentials(self.DIR)
|
||||||
|
|
||||||
def run_tests(self) -> None:
|
def run_tests(self) -> None:
|
||||||
logger.info("calling run_tests()")
|
logger.info("calling run_tests()")
|
||||||
|
|
@ -88,14 +88,15 @@ class Coordinator:
|
||||||
f.parent.rename(new_path)
|
f.parent.rename(new_path)
|
||||||
rmtree(trace_root_dir)
|
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.
|
"""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
|
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
|
users are not deleted after tests by accident, the user credentials are not known to an
|
||||||
attacker."""
|
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():
|
if not test_credentials_path.is_file():
|
||||||
test_credentials = {
|
test_credentials = {
|
||||||
"TEST_USER": "test-" + generate_random_string(6),
|
"TEST_USER": "test-" + generate_random_string(6),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue