forked from p15670423/monkey
Common, UT: remove unused AWS cloud instance infrastructure.
This infrastructure/classes store information about cloud instances monkeys are ran upon, but this data isn't used anywhere
This commit is contained in:
parent
2b4a51dc97
commit
6a472b524f
|
@ -4,7 +4,6 @@ import re
|
|||
|
||||
import requests
|
||||
|
||||
from common.cloud.environment_names import Environment
|
||||
from common.cloud.instance import CloudInstance
|
||||
|
||||
AWS_INSTANCE_METADATA_LOCAL_IP_ADDRESS = "169.254.169.254"
|
||||
|
@ -22,9 +21,6 @@ class AwsInstance(CloudInstance):
|
|||
def is_instance(self):
|
||||
return self.instance_id is not None
|
||||
|
||||
def get_cloud_provider_name(self) -> Environment:
|
||||
return Environment.AWS
|
||||
|
||||
def __init__(self):
|
||||
self.instance_id = None
|
||||
self.region = None
|
||||
|
|
|
@ -3,7 +3,6 @@ import requests
|
|||
import requests_mock
|
||||
|
||||
from common.cloud.aws.aws_instance import AWS_LATEST_METADATA_URI_PREFIX, AwsInstance
|
||||
from common.cloud.environment_names import Environment
|
||||
|
||||
INSTANCE_ID_RESPONSE = "i-1234567890abcdef0"
|
||||
|
||||
|
@ -78,10 +77,6 @@ def test_is_instance_good_data(good_data_mock_instance):
|
|||
assert good_data_mock_instance.is_instance()
|
||||
|
||||
|
||||
def test_get_cloud_provider_name_good_data(good_data_mock_instance):
|
||||
assert good_data_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
def test_get_instance_id_good_data(good_data_mock_instance):
|
||||
assert good_data_mock_instance.get_instance_id() == EXPECTED_INSTANCE_ID
|
||||
|
||||
|
@ -110,10 +105,6 @@ def test_is_instance_bad_region_data(bad_region_data_mock_instance):
|
|||
assert bad_region_data_mock_instance.is_instance()
|
||||
|
||||
|
||||
def test_get_cloud_provider_name_bad_region_data(bad_region_data_mock_instance):
|
||||
assert bad_region_data_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
def test_get_instance_id_bad_region_data(bad_region_data_mock_instance):
|
||||
assert bad_region_data_mock_instance.get_instance_id() == EXPECTED_INSTANCE_ID
|
||||
|
||||
|
@ -142,10 +133,6 @@ def test_is_instance_bad_account_id_data(bad_account_id_data_mock_instance):
|
|||
assert bad_account_id_data_mock_instance.is_instance()
|
||||
|
||||
|
||||
def test_get_cloud_provider_name_bad_account_id_data(bad_account_id_data_mock_instance):
|
||||
assert bad_account_id_data_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
def test_get_instance_id_bad_account_id_data(bad_account_id_data_mock_instance):
|
||||
assert bad_account_id_data_mock_instance.get_instance_id() == EXPECTED_INSTANCE_ID
|
||||
|
||||
|
@ -176,11 +163,6 @@ def test_is_instance_bad_instance_id_request(bad_instance_id_request_mock_instan
|
|||
assert bad_instance_id_request_mock_instance.is_instance() is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("instance_id_exception", [requests.RequestException, IOError])
|
||||
def test_get_cloud_provider_name_bad_instance_id_request(bad_instance_id_request_mock_instance):
|
||||
assert bad_instance_id_request_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
@pytest.mark.parametrize("instance_id_exception", [requests.RequestException, IOError])
|
||||
def test_get_instance_id_bad_instance_id_request(bad_instance_id_request_mock_instance):
|
||||
assert bad_instance_id_request_mock_instance.get_instance_id() is None
|
||||
|
@ -214,11 +196,6 @@ def test_is_instance_bad_region_request(bad_region_request_mock_instance):
|
|||
assert bad_region_request_mock_instance.is_instance()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("region_exception", [requests.RequestException, IOError])
|
||||
def test_get_cloud_provider_name_bad_region_request(bad_region_request_mock_instance):
|
||||
assert bad_region_request_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
@pytest.mark.parametrize("region_exception", [requests.RequestException, IOError])
|
||||
def test_get_instance_id_bad_region_request(bad_region_request_mock_instance):
|
||||
assert bad_region_request_mock_instance.get_instance_id() == EXPECTED_INSTANCE_ID
|
||||
|
@ -252,11 +229,6 @@ def test_is_instance_bad_account_id_request(bad_account_id_request_mock_instance
|
|||
assert bad_account_id_request_mock_instance.is_instance()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("account_id_exception", [requests.RequestException, IOError])
|
||||
def test_get_cloud_provider_name_bad_account_id_request(bad_account_id_request_mock_instance):
|
||||
assert bad_account_id_request_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
@pytest.mark.parametrize("account_id_exception", [requests.RequestException, IOError])
|
||||
def test_get_instance_id_bad_account_id_request(bad_account_id_request_mock_instance):
|
||||
assert bad_account_id_request_mock_instance.get_instance_id() == EXPECTED_INSTANCE_ID
|
||||
|
@ -296,10 +268,6 @@ def test_is_instance_not_found_request(not_found_request_mock_instance):
|
|||
assert not_found_request_mock_instance.is_instance() is False
|
||||
|
||||
|
||||
def test_get_cloud_provider_name_not_found_request(not_found_request_mock_instance):
|
||||
assert not_found_request_mock_instance.get_cloud_provider_name() == Environment.AWS
|
||||
|
||||
|
||||
def test_get_instance_id_not_found_request(not_found_request_mock_instance):
|
||||
assert not_found_request_mock_instance.get_instance_id() is None
|
||||
|
||||
|
|
Loading…
Reference in New Issue