From 04d72c0d365f738d883355b07e9b6b335dcd04f7 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 14 Jul 2022 13:11:45 -0400 Subject: [PATCH] UT: Use new Credentials object in test_credential_telem_send() --- .../telemetry/test_credentials_telem.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/monkey/tests/unit_tests/infection_monkey/telemetry/test_credentials_telem.py b/monkey/tests/unit_tests/infection_monkey/telemetry/test_credentials_telem.py index 701071fbb..1ceb9f4e5 100644 --- a/monkey/tests/unit_tests/infection_monkey/telemetry/test_credentials_telem.py +++ b/monkey/tests/unit_tests/infection_monkey/telemetry/test_credentials_telem.py @@ -2,7 +2,7 @@ import json import pytest -from common.credentials import Credentials, Password, SSHKeypair, Username +from common.credentials import Credentials, Password, Username from infection_monkey.telemetry.credentials_telem import CredentialsTelem USERNAME = "m0nkey" @@ -14,24 +14,15 @@ PRIVATE_KEY = "priv_key" @pytest.fixture def credentials_for_test(): - return Credentials( - [Username(USERNAME)], [Password(PASSWORD), SSHKeypair(PRIVATE_KEY, PUBLIC_KEY)] - ) + return Credentials(Username(USERNAME), Password(PASSWORD)) def test_credential_telem_send(spy_send_telemetry, credentials_for_test): expected_data = [ { - "identities": [{"username": USERNAME, "credential_type": "USERNAME"}], - "secrets": [ - {"password": PASSWORD, "credential_type": "PASSWORD"}, - { - "private_key": PRIVATE_KEY, - "public_key": PUBLIC_KEY, - "credential_type": "SSH_KEYPAIR", - }, - ], + "identity": {"username": USERNAME, "credential_type": "USERNAME"}, + "secret": {"password": PASSWORD, "credential_type": "PASSWORD"}, } ]