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:
parent
380203eb53
commit
9594f2cd8d
|
@ -1,4 +1,4 @@
|
||||||
import boto
|
import boto3
|
||||||
from moto import mock_sts, mock_elb
|
from moto import mock_sts, mock_elb
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,9 +6,23 @@ from moto import mock_sts, mock_elb
|
||||||
@mock_elb()
|
@mock_elb()
|
||||||
def test_get_all_elbs(app):
|
def test_get_all_elbs(app):
|
||||||
from lemur.plugins.lemur_aws.elb import get_all_elbs
|
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')
|
elbs = get_all_elbs(account_number='123456789012', region='us-east-1')
|
||||||
assert not elbs
|
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')
|
elbs = get_all_elbs(account_number='123456789012', region='us-east-1')
|
||||||
assert elbs
|
assert elbs
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -63,12 +63,12 @@ install_requires = [
|
||||||
'retrying==1.3.3',
|
'retrying==1.3.3',
|
||||||
'tabulate==0.7.7',
|
'tabulate==0.7.7',
|
||||||
'pem==16.1.0',
|
'pem==16.1.0',
|
||||||
'paramiko==2.1.2' #required for lemur_linuxdst plugin
|
'paramiko==2.1.2' # required for lemur_linuxdst plugin
|
||||||
]
|
]
|
||||||
|
|
||||||
tests_require = [
|
tests_require = [
|
||||||
'pyflakes',
|
'pyflakes',
|
||||||
'moto==0.4.31',
|
'moto==1.0.0',
|
||||||
'nose==1.3.7',
|
'nose==1.3.7',
|
||||||
'pytest==3.0.7',
|
'pytest==3.0.7',
|
||||||
'factory-boy==2.8.1',
|
'factory-boy==2.8.1',
|
||||||
|
|
Loading…
Reference in New Issue