From bdee3b9d8a2af078a16dd34969cde36b82e305bf Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 12 Jul 2022 11:57:30 -0400 Subject: [PATCH] UT: Improve formatting of test_mongo_credentials_repository.py --- .../test_mongo_credentials_repository.py | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py b/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py index 4b2a28849..e8776b440 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py +++ b/monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_credentials_repository.py @@ -44,72 +44,51 @@ def mongo_repository(): def test_mongo_repository_get_configured(mongo_repository): - actual_configured_credentials = mongo_repository.get_configured_credentials() assert actual_configured_credentials == [] def test_mongo_repository_get_stolen(mongo_repository): - actual_stolen_credentials = mongo_repository.get_stolen_credentials() assert actual_stolen_credentials == [] def test_mongo_repository_get_all(mongo_repository): - actual_credentials = mongo_repository.get_all_credentials() assert actual_credentials == [] def test_mongo_repository_configured(mongo_repository): - mongo_repository.save_configured_credentials(CREDENTIALS_LIST) - actual_configured_credentials = mongo_repository.get_configured_credentials() - assert actual_configured_credentials == CREDENTIALS_LIST mongo_repository.remove_configured_credentials() - actual_configured_credentials = mongo_repository.get_configured_credentials() - assert actual_configured_credentials == [] def test_mongo_repository_stolen(mongo_repository): - - mongo_repository.save_configured_credentials(CONFIGURED_CREDENTIALS) mongo_repository.save_stolen_credentials(STOLEN_CREDENTIALS) - actual_stolen_credentials = mongo_repository.get_stolen_credentials() - assert actual_stolen_credentials == STOLEN_CREDENTIALS mongo_repository.remove_stolen_credentials() - actual_stolen_credentials = mongo_repository.get_stolen_credentials() - assert actual_stolen_credentials == [] def test_mongo_repository_all(mongo_repository): - mongo_repository.save_configured_credentials(CONFIGURED_CREDENTIALS) mongo_repository.save_stolen_credentials(STOLEN_CREDENTIALS) - actual_credentials = mongo_repository.get_all_credentials() - assert actual_credentials == CREDENTIALS_LIST mongo_repository.remove_all_credentials() - actual_credentials = mongo_repository.get_all_credentials() - actual_stolen_credentials = mongo_repository.get_stolen_credentials() - actual_configured_credentials = mongo_repository.get_configured_credentials() - - assert actual_credentials == [] - assert actual_stolen_credentials == [] - assert actual_configured_credentials == [] + assert mongo_repository.get_all_credentials() == [] + assert mongo_repository.get_stolen_credentials() == [] + assert mongo_repository.get_configured_credentials() == []