Island: Remove disused Environment class
This commit is contained in:
parent
38a898824a
commit
69cbf3ff50
|
@ -1,5 +0,0 @@
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
|
|
||||||
class Environment(Enum):
|
|
||||||
AWS = "AWS"
|
|
|
@ -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
|
|
|
@ -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())
|
|
Loading…
Reference in New Issue