Tests: Decouple uses_encryptor() fixture from AuthenticationService

This commit is contained in:
Mike Salvatore 2021-10-04 17:22:52 -04:00
parent a24979155f
commit 8f9289517f
1 changed files with 1 additions and 6 deletions

View File

@ -11,7 +11,6 @@ from tests.unit_tests.monkey_island.cc.server_utils.encryption.test_password_bas
)
from monkey_island.cc.server_utils.encryption import initialize_datastore_encryptor
from monkey_island.cc.services.authentication import AuthenticationService
@pytest.fixture
@ -28,11 +27,7 @@ def monkey_config_json(monkey_config):
return json.dumps(monkey_config)
MOCK_USERNAME = "m0nk3y_u53r"
MOCK_PASSWORD = "3cr3t_p455w0rd"
@pytest.fixture
def uses_encryptor(data_for_tests_dir):
secret = AuthenticationService._get_secret_from_credentials(MOCK_USERNAME, MOCK_PASSWORD)
secret = "m0nk3y_u53r:3cr3t_p455w0rd"
initialize_datastore_encryptor(data_for_tests_dir, secret)