From 9594f2cd8d1bac33d13f945bf2bdf9e85433cd03 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 20 May 2017 10:40:22 -0700 Subject: [PATCH] Upgrading moto and fixing test that break due to deprecation. (#808) * Upgrading moto and fixing test that break due to deprecation. * Adding region. --- lemur/plugins/lemur_aws/tests/test_elb.py | 20 +++++++++++++++++--- setup.py | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lemur/plugins/lemur_aws/tests/test_elb.py b/lemur/plugins/lemur_aws/tests/test_elb.py index e19bba82..e34b66de 100644 --- a/lemur/plugins/lemur_aws/tests/test_elb.py +++ b/lemur/plugins/lemur_aws/tests/test_elb.py @@ -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 diff --git a/setup.py b/setup.py index b5930785..98b76a80 100644 --- a/setup.py +++ b/setup.py @@ -63,12 +63,12 @@ install_requires = [ 'retrying==1.3.3', 'tabulate==0.7.7', 'pem==16.1.0', - 'paramiko==2.1.2' #required for lemur_linuxdst plugin + 'paramiko==2.1.2' # required for lemur_linuxdst plugin ] tests_require = [ 'pyflakes', - 'moto==0.4.31', + 'moto==1.0.0', 'nose==1.3.7', 'pytest==3.0.7', 'factory-boy==2.8.1',