Cleanup flake8
This commit is contained in:
parent
161a5744d1
commit
59fe1abfdf
@ -1,7 +1,7 @@
|
||||
import boto
|
||||
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
|
||||
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_autoscaling
|
||||
|
||||
|
@ -2,9 +2,9 @@ import boto
|
||||
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
|
||||
from boto.ec2.autoscale.group import AutoScalingGroup
|
||||
from boto.ec2.autoscale.policy import ScalingPolicy
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_autoscaling, mock_ec2
|
||||
from moto import mock_autoscaling
|
||||
|
||||
|
||||
def setup_autoscale_group():
|
||||
@ -28,7 +28,7 @@ def setup_autoscale_group():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_create_policy():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -49,7 +49,7 @@ def test_create_policy():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_create_policy_default_values():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -68,7 +68,7 @@ def test_create_policy_default_values():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_update_policy():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -95,7 +95,7 @@ def test_update_policy():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_delete_policy():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -113,7 +113,7 @@ def test_delete_policy():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_execute_policy_exact_capacity():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -131,7 +131,7 @@ def test_execute_policy_exact_capacity():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_execute_policy_positive_change_in_capacity():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -149,7 +149,7 @@ def test_execute_policy_positive_change_in_capacity():
|
||||
|
||||
@mock_autoscaling
|
||||
def test_execute_policy_percent_change_in_capacity():
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
@ -170,7 +170,7 @@ def test_execute_policy_small_percent_change_in_capacity():
|
||||
""" http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
|
||||
If PercentChangeInCapacity returns a value between 0 and 1,
|
||||
Auto Scaling will round it off to 1."""
|
||||
group = setup_autoscale_group()
|
||||
setup_autoscale_group()
|
||||
conn = boto.connect_autoscale()
|
||||
policy = ScalingPolicy(
|
||||
name='ScaleUp',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
@ -11,7 +11,7 @@ Test the different ways that the decorator can be used
|
||||
|
||||
@mock_ec2
|
||||
def test_basic_connect():
|
||||
conn = boto.connect_ec2()
|
||||
boto.connect_ec2()
|
||||
|
||||
|
||||
@mock_ec2
|
||||
|
@ -1,5 +1,5 @@
|
||||
from mock import patch
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto.server import main
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto.core.utils import convert_regex_to_flask_path
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
from freezegun import freeze_time
|
||||
import sure # noqa
|
||||
import requests
|
||||
|
||||
from moto import mock_dynamodb
|
||||
from moto.dynamodb import dynamodb_backend
|
||||
|
||||
from boto.dynamodb import condition
|
||||
from boto.exception import DynamoDBResponseError
|
||||
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
||||
from moto import mock_dynamodb
|
||||
from moto.dynamodb import dynamodb_backend
|
||||
|
||||
from boto.dynamodb import condition
|
||||
from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError, DynamoDBValidationError
|
||||
@ -501,5 +500,4 @@ def test_batch_read():
|
||||
item.put()
|
||||
|
||||
items = table.batch_get_item([('the-key', '123'), ('another-key', '789')])
|
||||
count = len([item for item in items])
|
||||
count.should.equal(2)
|
||||
items.should.have.length_ofl(2)
|
||||
|
@ -1,9 +1,8 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
||||
from moto import mock_dynamodb
|
||||
from moto.dynamodb import dynamodb_backend
|
||||
|
||||
from boto.dynamodb import condition
|
||||
from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError
|
||||
@ -412,5 +411,4 @@ def test_batch_read():
|
||||
item.put()
|
||||
|
||||
items = table.batch_get_item([('the-key1'), ('another-key')])
|
||||
count = len([item for item in items])
|
||||
count.should.equal(2)
|
||||
items.should.have.length_of(2)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -3,7 +3,7 @@ import base64
|
||||
import boto
|
||||
from boto.ec2.instance import Reservation, InstanceAttribute
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import re
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import itertools
|
||||
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
@ -31,7 +31,7 @@ def test_instance_launch_and_retrieve_all_instances():
|
||||
|
||||
instance.add_tag("a key", "some value")
|
||||
chain = itertools.chain.from_iterable
|
||||
existing_instances = list(chain([reservation.instances for reservation in conn.get_all_instances()]))
|
||||
existing_instances = list(chain([res.instances for res in conn.get_all_instances()]))
|
||||
existing_instances.should.have.length_of(1)
|
||||
existing_instance = existing_instances[0]
|
||||
existing_instance.tags["a key"].should.equal("some value")
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import boto
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ec2
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import boto
|
||||
from boto.ec2.elb import HealthCheck
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_elb, mock_ec2
|
||||
|
||||
@ -11,7 +11,7 @@ def test_create_load_balancer():
|
||||
|
||||
zones = ['us-east-1a', 'us-east-1b']
|
||||
ports = [(80, 8080, 'http'), (443, 8443, 'tcp')]
|
||||
lb = conn.create_load_balancer('my-lb', zones, ports)
|
||||
conn.create_load_balancer('my-lb', zones, ports)
|
||||
|
||||
balancers = conn.get_all_load_balancers()
|
||||
balancer = balancers[0]
|
||||
@ -33,9 +33,9 @@ def test_get_load_balancers_by_name():
|
||||
|
||||
zones = ['us-east-1a', 'us-east-1b']
|
||||
ports = [(80, 8080, 'http'), (443, 8443, 'tcp')]
|
||||
lb = conn.create_load_balancer('my-lb1', zones, ports)
|
||||
lb = conn.create_load_balancer('my-lb2', zones, ports)
|
||||
lb = conn.create_load_balancer('my-lb3', zones, ports)
|
||||
conn.create_load_balancer('my-lb1', zones, ports)
|
||||
conn.create_load_balancer('my-lb2', zones, ports)
|
||||
conn.create_load_balancer('my-lb3', zones, ports)
|
||||
|
||||
conn.get_all_load_balancers().should.have.length_of(3)
|
||||
conn.get_all_load_balancers(load_balancer_names=['my-lb1']).should.have.length_of(1)
|
||||
@ -48,7 +48,7 @@ def test_delete_load_balancer():
|
||||
|
||||
zones = ['us-east-1a']
|
||||
ports = [(80, 8080, 'http'), (443, 8443, 'tcp')]
|
||||
lb = conn.create_load_balancer('my-lb', zones, ports)
|
||||
conn.create_load_balancer('my-lb', zones, ports)
|
||||
|
||||
balancers = conn.get_all_load_balancers()
|
||||
balancers.should.have.length_of(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import datetime
|
||||
import urllib2
|
||||
|
||||
import boto
|
||||
@ -7,7 +6,7 @@ from boto.s3.key import Key
|
||||
from freezegun import freeze_time
|
||||
import requests
|
||||
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_s3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -3,7 +3,7 @@ import email
|
||||
import boto
|
||||
from boto.exception import BotoServerError
|
||||
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_ses
|
||||
|
||||
@ -44,7 +44,8 @@ def test_delete_identity():
|
||||
def test_send_email():
|
||||
conn = boto.connect_ses('the_key', 'the_secret')
|
||||
|
||||
conn.send_email.when.called_with("test@example.com", "test subject",
|
||||
conn.send_email.when.called_with(
|
||||
"test@example.com", "test subject",
|
||||
"test body", "test_to@example.com").should.throw(BotoServerError)
|
||||
|
||||
conn.verify_email_identity("test@example.com")
|
||||
@ -74,12 +75,18 @@ def test_send_raw_email():
|
||||
part.add_header('Content-Disposition', 'attachment; filename=test.txt')
|
||||
message.attach(part)
|
||||
|
||||
conn.send_raw_email.when.called_with(source=message['From'], raw_message=message.as_string(),
|
||||
destinations=message['To']).should.throw(BotoServerError)
|
||||
conn.send_raw_email.when.called_with(
|
||||
source=message['From'],
|
||||
raw_message=message.as_string(),
|
||||
destinations=message['To']
|
||||
).should.throw(BotoServerError)
|
||||
|
||||
conn.verify_email_identity("test@example.com")
|
||||
conn.send_raw_email(source=message['From'], raw_message=message.as_string(),
|
||||
destinations=message['To'])
|
||||
conn.send_raw_email(
|
||||
source=message['From'],
|
||||
raw_message=message.as_string(),
|
||||
destinations=message['To']
|
||||
)
|
||||
|
||||
send_quota = conn.get_send_quota()
|
||||
sent_count = int(send_quota['GetSendQuotaResponse']['GetSendQuotaResult']['SentLast24Hours'])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import re
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -2,7 +2,7 @@ import boto
|
||||
from boto.exception import SQSError
|
||||
from boto.sqs.message import RawMessage
|
||||
import requests
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_sqs
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import json
|
||||
|
||||
import boto
|
||||
from boto.exception import BotoServerError
|
||||
from freezegun import freeze_time
|
||||
import sure # flake8: noqa
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_sts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user