From c2c609aa3a2eab3773b0ab49f616a18b3474db1e Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 3 Feb 2022 14:05:19 +0530 Subject: [PATCH] UT: Remove Scoutsuite's unit tests --- .../test_scoutsuite_auth_service.py | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 monkey/tests/unit_tests/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py b/monkey/tests/unit_tests/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py deleted file mode 100644 index 39dfd7ae5..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py +++ /dev/null @@ -1,38 +0,0 @@ -from unittest.mock import MagicMock - -import dpath.util -import pytest - -from common.config_value_paths import AWS_KEYS_PATH -from monkey_island.cc.database import mongo -from monkey_island.cc.server_utils.encryption import get_datastore_encryptor -from monkey_island.cc.services.config import ConfigService -from monkey_island.cc.services.zero_trust.scoutsuite.scoutsuite_auth_service import ( - is_aws_keys_setup, -) - - -class MockObject: - pass - - -@pytest.mark.slow -@pytest.mark.usefixtures("uses_database", "uses_encryptor") -def test_is_aws_keys_setup(tmp_path): - # Mock default configuration - ConfigService.init_default_config() - mongo.db = MockObject() - mongo.db.config = MockObject() - ConfigService.encrypt_config(ConfigService.default_config) - mongo.db.config.find_one = MagicMock(return_value=ConfigService.default_config) - assert not is_aws_keys_setup() - - bogus_key_value = get_datastore_encryptor().encrypt("bogus_aws_key") - dpath.util.set( - ConfigService.default_config, AWS_KEYS_PATH + ["aws_secret_access_key"], bogus_key_value - ) - dpath.util.set( - ConfigService.default_config, AWS_KEYS_PATH + ["aws_access_key_id"], bogus_key_value - ) - - assert is_aws_keys_setup()