@mock_elb needs to be changed to @mock_elb_deprecated as well

This commit is contained in:
rallytime 2017-08-10 17:15:45 -04:00
parent 6ae1111295
commit 60b406e088

View file

@ -15,7 +15,7 @@ except ImportError:
HAS_BOTO = False
try:
from moto import mock_ec2_deprecated, mock_elb
from moto import mock_ec2_deprecated, mock_elb_deprecated
HAS_MOTO = True
except ImportError:
HAS_MOTO = False
@ -24,19 +24,19 @@ except ImportError:
'''
if the mock_ec2_deprecated function is not available due to import failure
this replaces the decorated function with stub_function.
Allows boto_vpc unit tests to use the @mock_ec2_deprecated decorator
Allows boto_elb unit tests to use the @mock_ec2_deprecated decorator
without a "NameError: name 'mock_ec2_deprecated' is not defined" error.
'''
def stub_function(self):
pass
return stub_function
def mock_elb(self):
def mock_elb_deprecated(self):
'''
if the mock_ec2_deprecated function is not available due to import failure
if the mock_elb_deprecated function is not available due to import failure
this replaces the decorated function with stub_function.
Allows boto_vpc unit tests to use the @mock_ec2_deprecated decorator
without a "NameError: name 'mock_ec2_deprecated' is not defined" error.
Allows boto_elb unit tests to use the @mock_elb_deprecated decorator
without a "NameError: name 'mock_elb_deprecated' is not defined" error.
'''
def stub_function(self):
pass
@ -84,7 +84,7 @@ class BotoElbTestCase(TestCase):
TestCase for salt.modules.boto_elb module
'''
@mock_ec2_deprecated
@mock_elb
@mock_elb_deprecated
def test_register_instances_valid_id_result_true(self):
'''
tests that given a valid instance id and valid ELB that
@ -103,7 +103,7 @@ class BotoElbTestCase(TestCase):
self.assertEqual(True, register_result)
@mock_ec2_deprecated
@mock_elb
@mock_elb_deprecated
def test_register_instances_valid_id_string(self):
'''
tests that given a string containing a instance id and valid ELB that
@ -126,7 +126,7 @@ class BotoElbTestCase(TestCase):
self.assertEqual([reservations.instances[0].id], registered_instance_ids)
@mock_ec2_deprecated
@mock_elb
@mock_elb_deprecated
def test_deregister_instances_valid_id_result_true(self):
'''
tests that given an valid id the boto_elb deregister_instances method
@ -147,7 +147,7 @@ class BotoElbTestCase(TestCase):
self.assertEqual(True, deregister_result)
@mock_ec2_deprecated
@mock_elb
@mock_elb_deprecated
def test_deregister_instances_valid_id_string(self):
'''
tests that given an valid id the boto_elb deregister_instances method
@ -173,7 +173,7 @@ class BotoElbTestCase(TestCase):
self.assertEqual(actual_instances, expected_instances)
@mock_ec2_deprecated
@mock_elb
@mock_elb_deprecated
def test_deregister_instances_valid_id_list(self):
'''
tests that given an valid ids in the form of a list that the boto_elb