Upgrading moto and fixing test that break due to deprecation. (#808)

* Upgrading moto and fixing test that break due to deprecation.

* Adding region.
This commit is contained in:
kevgliss 2017-05-20 10:40:22 -07:00 committed by GitHub
parent 380203eb53
commit 9594f2cd8d
2 changed files with 19 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import boto
import boto3
from moto import mock_sts, mock_elb
@ -6,9 +6,23 @@ from moto import mock_sts, mock_elb
@mock_elb()
def test_get_all_elbs(app):
from lemur.plugins.lemur_aws.elb import get_all_elbs
conn = boto.ec2.elb.connect_to_region('us-east-1')
client = boto3.client('elb', region_name='us-east-1')
elbs = get_all_elbs(account_number='123456789012', region='us-east-1')
assert not elbs
conn.create_load_balancer('example-lb', ['us-east-1a', 'us-east-1b'], [(443, 5443, 'tcp')])
client.create_load_balancer(
LoadBalancerName='example-lb',
Listeners=[
{
'Protocol': 'string',
'LoadBalancerPort': 443,
'InstanceProtocol': 'tcp',
'InstancePort': 5443,
'SSLCertificateId': 'tcp'
}
]
)
elbs = get_all_elbs(account_number='123456789012', region='us-east-1')
assert elbs

View File

@ -68,7 +68,7 @@ install_requires = [
tests_require = [
'pyflakes',
'moto==0.4.31',
'moto==1.0.0',
'nose==1.3.7',
'pytest==3.0.7',
'factory-boy==2.8.1',