From 69cbf3ff5035e1555a17556def7ed17236e3bd36 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 19 Nov 2021 08:41:42 -0500 Subject: [PATCH] Island: Remove disused Environment class --- monkey/common/cloud/environment_names.py | 5 ---- .../monkey_island/cc/environment/__init__.py | 26 ------------------- .../cc/environment/test_environment.py | 16 ------------ 3 files changed, 47 deletions(-) delete mode 100644 monkey/common/cloud/environment_names.py delete mode 100644 monkey/tests/unit_tests/monkey_island/cc/environment/test_environment.py diff --git a/monkey/common/cloud/environment_names.py b/monkey/common/cloud/environment_names.py deleted file mode 100644 index 438c64379..000000000 --- a/monkey/common/cloud/environment_names.py +++ /dev/null @@ -1,5 +0,0 @@ -from enum import Enum - - -class Environment(Enum): - AWS = "AWS" diff --git a/monkey/monkey_island/cc/environment/__init__.py b/monkey/monkey_island/cc/environment/__init__.py index 6fd241cb0..e69de29bb 100644 --- a/monkey/monkey_island/cc/environment/__init__.py +++ b/monkey/monkey_island/cc/environment/__init__.py @@ -1,26 +0,0 @@ -import logging -from abc import ABCMeta, abstractmethod -from datetime import timedelta - -from common.utils.exceptions import ( - AlreadyRegisteredError, - InvalidRegistrationCredentialsError, -) -from monkey_island.cc.environment.environment_config import EnvironmentConfig - -logger = logging.getLogger(__name__) - - -class Environment(object, metaclass=ABCMeta): - _testing = False - - def __init__(self, config: EnvironmentConfig): - self._testing = False # Assume env is not for unit testing. - - @property - def testing(self): - return self._testing - - @testing.setter - def testing(self, value): - self._testing = value diff --git a/monkey/tests/unit_tests/monkey_island/cc/environment/test_environment.py b/monkey/tests/unit_tests/monkey_island/cc/environment/test_environment.py deleted file mode 100644 index b6ae69cb6..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/environment/test_environment.py +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Dict -from unittest import TestCase - -from monkey_island.cc.environment import Environment, EnvironmentConfig - - -class TestEnvironment(TestCase): - def _test_bool_env_method( - self, method_name: str, env: Environment, config: Dict, expected_result: bool - ): - env._config = EnvironmentConfig(config) - method = getattr(env, method_name) - if expected_result: - self.assertTrue(method()) - else: - self.assertFalse(method())