@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 3055e17ed5
commit 7c1d493fdd

View file

@ -16,7 +16,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
@ -25,19 +25,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
@ -115,7 +115,7 @@ class BotoElbTestCase(TestCase, LoaderModuleMockMixin):
boto_elb.__virtual__()
@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
@ -134,7 +134,7 @@ class BotoElbTestCase(TestCase, LoaderModuleMockMixin):
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
@ -157,7 +157,7 @@ class BotoElbTestCase(TestCase, LoaderModuleMockMixin):
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
@ -178,7 +178,7 @@ class BotoElbTestCase(TestCase, LoaderModuleMockMixin):
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
@ -204,7 +204,7 @@ class BotoElbTestCase(TestCase, LoaderModuleMockMixin):
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