From f806f848fafbb1105a26b48484370e34e6fa68af Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 7 Jul 2022 10:25:23 +0200 Subject: [PATCH] UT: Return a list in Propagation Credentials * Add TODOs to change to Credentials from common.credentials --- .../monkey_island/stub_propagation_credentials_repository.py | 1 + .../monkey_island/cc/resources/test_propagation_credentials.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey/tests/monkey_island/stub_propagation_credentials_repository.py b/monkey/tests/monkey_island/stub_propagation_credentials_repository.py index 7eeec1815..7bf6f85a7 100644 --- a/monkey/tests/monkey_island/stub_propagation_credentials_repository.py +++ b/monkey/tests/monkey_island/stub_propagation_credentials_repository.py @@ -32,6 +32,7 @@ PROPAGATION_CREDENTIALS_2 = { } +# TODO: Use Credentials from common.credentials when serialization is implemented class StubPropagationCredentialsRepository(ICredentialsRepository): def get_configured_credentials(self) -> Sequence[Credentials]: pass diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_propagation_credentials.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_propagation_credentials.py index e1469b1ea..08b8e942f 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_propagation_credentials.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_propagation_credentials.py @@ -29,9 +29,10 @@ def test_propagation_credentials_endpoint_get(flask_client): resp = flask_client.get(propagation_credentials_url) assert resp.status_code == 200 - actual_propagation_credentials = json.loads(resp.data)["propagation_credentials"] + actual_propagation_credentials = json.loads(resp.data) assert len(actual_propagation_credentials) == 2 + # TODO: delete the removal of monkey_guid key when the serialization of credentials del actual_propagation_credentials[0]["monkey_guid"] assert actual_propagation_credentials[0] == PROPAGATION_CREDENTIALS_1 del actual_propagation_credentials[1]["monkey_guid"]