diff --git a/moto/__init__.py b/moto/__init__.py index 8aa959cf..fa1fa6ec 100644 --- a/moto/__init__.py +++ b/moto/__init__.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import logging logging.getLogger('boto').setLevel(logging.CRITICAL) diff --git a/moto/autoscaling/__init__.py b/moto/autoscaling/__init__.py index b1df2169..ecd82ab0 100644 --- a/moto/autoscaling/__init__.py +++ b/moto/autoscaling/__init__.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .models import autoscaling_backend, autoscaling_backends from ..core.models import MockAWS diff --git a/moto/autoscaling/models.py b/moto/autoscaling/models.py index 6571c97d..0a7ae0e7 100644 --- a/moto/autoscaling/models.py +++ b/moto/autoscaling/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping from moto.core import BaseBackend from moto.ec2 import ec2_backends diff --git a/moto/autoscaling/responses.py b/moto/autoscaling/responses.py index 1b893e42..36ce758f 100644 --- a/moto/autoscaling/responses.py +++ b/moto/autoscaling/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/autoscaling/urls.py b/moto/autoscaling/urls.py index affa69c9..336cade3 100644 --- a/moto/autoscaling/urls.py +++ b/moto/autoscaling/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import AutoScalingResponse url_bases = [ diff --git a/moto/backends.py b/moto/backends.py index ed237401..46f932d3 100644 --- a/moto/backends.py +++ b/moto/backends.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.autoscaling import autoscaling_backend from moto.dynamodb import dynamodb_backend from moto.dynamodb2 import dynamodb_backend2 diff --git a/moto/cloudformation/__init__.py b/moto/cloudformation/__init__.py index 45726c8b..17d520ba 100644 --- a/moto/cloudformation/__init__.py +++ b/moto/cloudformation/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import cloudformation_backend mock_cloudformation = cloudformation_backend.decorator diff --git a/moto/cloudformation/models.py b/moto/cloudformation/models.py index 50d06fc1..20672f5a 100644 --- a/moto/cloudformation/models.py +++ b/moto/cloudformation/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from moto.core import BaseBackend diff --git a/moto/cloudformation/parsing.py b/moto/cloudformation/parsing.py index 79774397..2f800f7c 100644 --- a/moto/cloudformation/parsing.py +++ b/moto/cloudformation/parsing.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import collections import logging diff --git a/moto/cloudformation/responses.py b/moto/cloudformation/responses.py index ef31670a..23d0be77 100644 --- a/moto/cloudformation/responses.py +++ b/moto/cloudformation/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from jinja2 import Template diff --git a/moto/cloudformation/urls.py b/moto/cloudformation/urls.py index 4d4c0ddb..f2cfb020 100644 --- a/moto/cloudformation/urls.py +++ b/moto/cloudformation/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import CloudFormationResponse url_bases = [ diff --git a/moto/cloudformation/utils.py b/moto/cloudformation/utils.py index e7f5e98c..09cffd6a 100644 --- a/moto/cloudformation/utils.py +++ b/moto/cloudformation/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import uuid diff --git a/moto/core/__init__.py b/moto/core/__init__.py index 4bf815e7..7e8c3110 100644 --- a/moto/core/__init__.py +++ b/moto/core/__init__.py @@ -1 +1,2 @@ +from __future__ import unicode_literals from .models import BaseBackend diff --git a/moto/core/models.py b/moto/core/models.py index 7460d2d9..ec77d50f 100644 --- a/moto/core/models.py +++ b/moto/core/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import functools import re diff --git a/moto/core/responses.py b/moto/core/responses.py index 4c346b17..1c76aa24 100644 --- a/moto/core/responses.py +++ b/moto/core/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import datetime import json import re diff --git a/moto/core/utils.py b/moto/core/utils.py index 9926a2a3..28024878 100644 --- a/moto/core/utils.py +++ b/moto/core/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import inspect import random import re diff --git a/moto/dynamodb/__init__.py b/moto/dynamodb/__init__.py index 3312203f..6f2509f7 100644 --- a/moto/dynamodb/__init__.py +++ b/moto/dynamodb/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import dynamodb_backend mock_dynamodb = dynamodb_backend.decorator diff --git a/moto/dynamodb/comparisons.py b/moto/dynamodb/comparisons.py index 58fa43c4..86f58217 100644 --- a/moto/dynamodb/comparisons.py +++ b/moto/dynamodb/comparisons.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # TODO add tests for all of these COMPARISON_FUNCS = { 'EQ': lambda item_value, test_value: item_value == test_value, diff --git a/moto/dynamodb/models.py b/moto/dynamodb/models.py index f4960702..be009ede 100644 --- a/moto/dynamodb/models.py +++ b/moto/dynamodb/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from collections import defaultdict import datetime import json diff --git a/moto/dynamodb/responses.py b/moto/dynamodb/responses.py index b2cc29e8..742f17f0 100644 --- a/moto/dynamodb/responses.py +++ b/moto/dynamodb/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from moto.core.responses import BaseResponse diff --git a/moto/dynamodb/urls.py b/moto/dynamodb/urls.py index 6ed5e00d..1afd3435 100644 --- a/moto/dynamodb/urls.py +++ b/moto/dynamodb/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import DynamoHandler url_bases = [ diff --git a/moto/dynamodb/utils.py b/moto/dynamodb/utils.py index 5ca887da..1adee245 100644 --- a/moto/dynamodb/utils.py +++ b/moto/dynamodb/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import calendar diff --git a/moto/dynamodb2/__init__.py b/moto/dynamodb2/__init__.py index db523803..8579c48d 100644 --- a/moto/dynamodb2/__init__.py +++ b/moto/dynamodb2/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import dynamodb_backend2 mock_dynamodb2 = dynamodb_backend2.decorator diff --git a/moto/dynamodb2/comparisons.py b/moto/dynamodb2/comparisons.py index 58fa43c4..86f58217 100644 --- a/moto/dynamodb2/comparisons.py +++ b/moto/dynamodb2/comparisons.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # TODO add tests for all of these COMPARISON_FUNCS = { 'EQ': lambda item_value, test_value: item_value == test_value, diff --git a/moto/dynamodb2/models.py b/moto/dynamodb2/models.py index 3a330ef1..af44569d 100644 --- a/moto/dynamodb2/models.py +++ b/moto/dynamodb2/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from collections import defaultdict import datetime import json diff --git a/moto/dynamodb2/responses.py b/moto/dynamodb2/responses.py index 8f90e8b0..94a7da4f 100644 --- a/moto/dynamodb2/responses.py +++ b/moto/dynamodb2/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from moto.core.responses import BaseResponse diff --git a/moto/dynamodb2/urls.py b/moto/dynamodb2/urls.py index 6ed5e00d..1afd3435 100644 --- a/moto/dynamodb2/urls.py +++ b/moto/dynamodb2/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import DynamoHandler url_bases = [ diff --git a/moto/dynamodb2/utils.py b/moto/dynamodb2/utils.py index 5ca887da..1adee245 100644 --- a/moto/dynamodb2/utils.py +++ b/moto/dynamodb2/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import calendar diff --git a/moto/ec2/__init__.py b/moto/ec2/__init__.py index dc34e5f6..649c8737 100644 --- a/moto/ec2/__init__.py +++ b/moto/ec2/__init__.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .models import ec2_backends, ec2_backend from ..core.models import MockAWS diff --git a/moto/ec2/exceptions.py b/moto/ec2/exceptions.py index 133a11ad..4a2b2a6d 100644 --- a/moto/ec2/exceptions.py +++ b/moto/ec2/exceptions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from werkzeug.exceptions import BadRequest from jinja2 import Template diff --git a/moto/ec2/models.py b/moto/ec2/models.py index df15b7f1..52cb6200 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import copy import itertools from collections import defaultdict diff --git a/moto/ec2/responses/__init__.py b/moto/ec2/responses/__init__.py index 13b6ce01..f051a7ca 100644 --- a/moto/ec2/responses/__init__.py +++ b/moto/ec2/responses/__init__.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from .amazon_dev_pay import AmazonDevPay from .amis import AmisResponse from .availability_zones_and_regions import AvailabilityZonesAndRegions diff --git a/moto/ec2/responses/amazon_dev_pay.py b/moto/ec2/responses/amazon_dev_pay.py index d0ef8893..af10a8d6 100644 --- a/moto/ec2/responses/amazon_dev_pay.py +++ b/moto/ec2/responses/amazon_dev_pay.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/amis.py b/moto/ec2/responses/amis.py index 4dcb0a24..a78a4928 100644 --- a/moto/ec2/responses/amis.py +++ b/moto/ec2/responses/amis.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/availability_zones_and_regions.py b/moto/ec2/responses/availability_zones_and_regions.py index 1e1b482a..a47d9a49 100644 --- a/moto/ec2/responses/availability_zones_and_regions.py +++ b/moto/ec2/responses/availability_zones_and_regions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/customer_gateways.py b/moto/ec2/responses/customer_gateways.py index 1f30a9d1..150ed755 100644 --- a/moto/ec2/responses/customer_gateways.py +++ b/moto/ec2/responses/customer_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/dhcp_options.py b/moto/ec2/responses/dhcp_options.py index 4fb127d6..09e535c8 100644 --- a/moto/ec2/responses/dhcp_options.py +++ b/moto/ec2/responses/dhcp_options.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse from moto.ec2.utils import ( diff --git a/moto/ec2/responses/elastic_block_store.py b/moto/ec2/responses/elastic_block_store.py index bd88c559..9d48f0e8 100644 --- a/moto/ec2/responses/elastic_block_store.py +++ b/moto/ec2/responses/elastic_block_store.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/elastic_ip_addresses.py b/moto/ec2/responses/elastic_ip_addresses.py index afd47498..7169eb85 100644 --- a/moto/ec2/responses/elastic_ip_addresses.py +++ b/moto/ec2/responses/elastic_ip_addresses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/elastic_network_interfaces.py b/moto/ec2/responses/elastic_network_interfaces.py index 985fc334..596b2be9 100644 --- a/moto/ec2/responses/elastic_network_interfaces.py +++ b/moto/ec2/responses/elastic_network_interfaces.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/general.py b/moto/ec2/responses/general.py index 721aaaeb..2e551491 100644 --- a/moto/ec2/responses/general.py +++ b/moto/ec2/responses/general.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index b4b3bedb..a420e28d 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/internet_gateways.py b/moto/ec2/responses/internet_gateways.py index 9309baae..1e60f7cb 100644 --- a/moto/ec2/responses/internet_gateways.py +++ b/moto/ec2/responses/internet_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.ec2.models import ec2_backend from moto.ec2.utils import sequence_from_querystring diff --git a/moto/ec2/responses/ip_addresses.py b/moto/ec2/responses/ip_addresses.py index 7d79d2a7..1a242211 100644 --- a/moto/ec2/responses/ip_addresses.py +++ b/moto/ec2/responses/ip_addresses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/key_pairs.py b/moto/ec2/responses/key_pairs.py index 88325199..a57686d2 100644 --- a/moto/ec2/responses/key_pairs.py +++ b/moto/ec2/responses/key_pairs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse from moto.ec2.models import ec2_backend @@ -32,7 +33,7 @@ class KeyPairs(BaseResponse): DESCRIBE_KEY_PAIRS_RESPONSE = """ - 59dbff89-35bd-4eac-99ed-be587EXAMPLE + 59dbff89-35bd-4eac-99ed-be587EXAMPLE {% for keypair in keypairs %} @@ -55,6 +56,6 @@ CREATE_KEY_PAIR_RESPONSE = """ - 59dbff89-35bd-4eac-99ed-be587EXAMPLE + 59dbff89-35bd-4eac-99ed-be587EXAMPLE {{ success }} """ diff --git a/moto/ec2/responses/monitoring.py b/moto/ec2/responses/monitoring.py index 40a2a743..ebb99cf8 100644 --- a/moto/ec2/responses/monitoring.py +++ b/moto/ec2/responses/monitoring.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/network_acls.py b/moto/ec2/responses/network_acls.py index 56ac36c3..c0978c30 100644 --- a/moto/ec2/responses/network_acls.py +++ b/moto/ec2/responses/network_acls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/placement_groups.py b/moto/ec2/responses/placement_groups.py index 2260b885..2d23239d 100644 --- a/moto/ec2/responses/placement_groups.py +++ b/moto/ec2/responses/placement_groups.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/reserved_instances.py b/moto/ec2/responses/reserved_instances.py index bab7967f..d0fbbb98 100644 --- a/moto/ec2/responses/reserved_instances.py +++ b/moto/ec2/responses/reserved_instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/route_tables.py b/moto/ec2/responses/route_tables.py index b9dcfcce..3b76a156 100644 --- a/moto/ec2/responses/route_tables.py +++ b/moto/ec2/responses/route_tables.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/security_groups.py b/moto/ec2/responses/security_groups.py index c848c0a0..d61006da 100644 --- a/moto/ec2/responses/security_groups.py +++ b/moto/ec2/responses/security_groups.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/spot_instances.py b/moto/ec2/responses/spot_instances.py index c0507740..fd848093 100644 --- a/moto/ec2/responses/spot_instances.py +++ b/moto/ec2/responses/spot_instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/subnets.py b/moto/ec2/responses/subnets.py index d427228d..64d34a5d 100644 --- a/moto/ec2/responses/subnets.py +++ b/moto/ec2/responses/subnets.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/tags.py b/moto/ec2/responses/tags.py index 6a12cf00..ab0c6e4c 100644 --- a/moto/ec2/responses/tags.py +++ b/moto/ec2/responses/tags.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/virtual_private_gateways.py b/moto/ec2/responses/virtual_private_gateways.py index e2bdac7d..18e1e99f 100644 --- a/moto/ec2/responses/virtual_private_gateways.py +++ b/moto/ec2/responses/virtual_private_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/vm_export.py b/moto/ec2/responses/vm_export.py index 8a88a709..98c3dd3e 100644 --- a/moto/ec2/responses/vm_export.py +++ b/moto/ec2/responses/vm_export.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/vm_import.py b/moto/ec2/responses/vm_import.py index a30cf706..ea88bdc9 100644 --- a/moto/ec2/responses/vm_import.py +++ b/moto/ec2/responses/vm_import.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/vpc_peering_connections.py b/moto/ec2/responses/vpc_peering_connections.py index 8fbefa31..3b1c7424 100644 --- a/moto/ec2/responses/vpc_peering_connections.py +++ b/moto/ec2/responses/vpc_peering_connections.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/vpcs.py b/moto/ec2/responses/vpcs.py index 609df625..bdb3fe84 100644 --- a/moto/ec2/responses/vpcs.py +++ b/moto/ec2/responses/vpcs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/vpn_connections.py b/moto/ec2/responses/vpn_connections.py index 61c34336..ad947efe 100644 --- a/moto/ec2/responses/vpn_connections.py +++ b/moto/ec2/responses/vpn_connections.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/responses/windows.py b/moto/ec2/responses/windows.py index 809c82a1..0a5e31a0 100644 --- a/moto/ec2/responses/windows.py +++ b/moto/ec2/responses/windows.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core.responses import BaseResponse diff --git a/moto/ec2/urls.py b/moto/ec2/urls.py index 65413369..e2768908 100644 --- a/moto/ec2/urls.py +++ b/moto/ec2/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import EC2Response diff --git a/moto/ec2/utils.py b/moto/ec2/utils.py index 77dce0d1..bb4532db 100644 --- a/moto/ec2/utils.py +++ b/moto/ec2/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import random import re diff --git a/moto/elb/__init__.py b/moto/elb/__init__.py index fcadac99..fbee0722 100644 --- a/moto/elb/__init__.py +++ b/moto/elb/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import elb_backend mock_elb = elb_backend.decorator diff --git a/moto/elb/models.py b/moto/elb/models.py index 6a6bc6f6..0f3da0fa 100644 --- a/moto/elb/models.py +++ b/moto/elb/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core import BaseBackend diff --git a/moto/elb/responses.py b/moto/elb/responses.py index 8f92a914..1e777bec 100644 --- a/moto/elb/responses.py +++ b/moto/elb/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/elb/urls.py b/moto/elb/urls.py index e41ed292..ee7703ff 100644 --- a/moto/elb/urls.py +++ b/moto/elb/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import ELBResponse url_bases = [ diff --git a/moto/emr/__init__.py b/moto/emr/__init__.py index 7d4de9a5..ad7c7596 100644 --- a/moto/emr/__init__.py +++ b/moto/emr/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import emr_backend mock_emr = emr_backend.decorator diff --git a/moto/emr/models.py b/moto/emr/models.py index 6c204562..26e8f2a6 100644 --- a/moto/emr/models.py +++ b/moto/emr/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core import BaseBackend from .utils import random_job_id, random_instance_group_id diff --git a/moto/emr/responses.py b/moto/emr/responses.py index c4636ea8..c3bcab96 100644 --- a/moto/emr/responses.py +++ b/moto/emr/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/emr/urls.py b/moto/emr/urls.py index 8919362f..0daa41e0 100644 --- a/moto/emr/urls.py +++ b/moto/emr/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import ElasticMapReduceResponse url_bases = [ diff --git a/moto/emr/utils.py b/moto/emr/utils.py index 88777fa3..c78b9772 100644 --- a/moto/emr/utils.py +++ b/moto/emr/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import random import string diff --git a/moto/iam/__init__.py b/moto/iam/__init__.py index 72e751fc..483969e1 100644 --- a/moto/iam/__init__.py +++ b/moto/iam/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import iam_backend mock_iam = iam_backend.decorator diff --git a/moto/iam/models.py b/moto/iam/models.py index 440c32c6..e949cf17 100644 --- a/moto/iam/models.py +++ b/moto/iam/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core import BaseBackend from .utils import random_resource_id diff --git a/moto/iam/responses.py b/moto/iam/responses.py index d8f6fb41..35f1ad09 100644 --- a/moto/iam/responses.py +++ b/moto/iam/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/iam/urls.py b/moto/iam/urls.py index f5dbfe75..8c05a6f0 100644 --- a/moto/iam/urls.py +++ b/moto/iam/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import IamResponse url_bases = [ diff --git a/moto/iam/utils.py b/moto/iam/utils.py index 64facde4..c7e76f7b 100644 --- a/moto/iam/utils.py +++ b/moto/iam/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import random import string diff --git a/moto/route53/__init__.py b/moto/route53/__init__.py index 6448c3c3..2c6bd223 100644 --- a/moto/route53/__init__.py +++ b/moto/route53/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import route53_backend mock_route53 = route53_backend.decorator diff --git a/moto/route53/models.py b/moto/route53/models.py index 1b206750..f825ba16 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core import BaseBackend from moto.core.utils import get_random_hex diff --git a/moto/route53/responses.py b/moto/route53/responses.py index 598591d6..40f38cb6 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from urlparse import parse_qs, urlparse from .models import route53_backend diff --git a/moto/route53/urls.py b/moto/route53/urls.py index 7b76e6b2..f336b9be 100644 --- a/moto/route53/urls.py +++ b/moto/route53/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import responses url_bases = [ diff --git a/moto/s3/__init__.py b/moto/s3/__init__.py index 4cb22ffc..6590d432 100644 --- a/moto/s3/__init__.py +++ b/moto/s3/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import s3_backend mock_s3 = s3_backend.decorator diff --git a/moto/s3/exceptions.py b/moto/s3/exceptions.py index 6633c62d..52d8face 100644 --- a/moto/s3/exceptions.py +++ b/moto/s3/exceptions.py @@ -1,3 +1,6 @@ +from __future__ import unicode_literals + + class BucketAlreadyExists(Exception): pass diff --git a/moto/s3/models.py b/moto/s3/models.py index b224fbe2..d433fd34 100644 --- a/moto/s3/models.py +++ b/moto/s3/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import os import base64 import datetime diff --git a/moto/s3/responses.py b/moto/s3/responses.py index 02773526..d704a6f6 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from urlparse import parse_qs, urlparse import re diff --git a/moto/s3/urls.py b/moto/s3/urls.py index cfd673b2..c775d02c 100644 --- a/moto/s3/urls.py +++ b/moto/s3/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import S3ResponseInstance url_bases = [ diff --git a/moto/s3/utils.py b/moto/s3/utils.py index 0fecfb2c..3f4ab1d6 100644 --- a/moto/s3/utils.py +++ b/moto/s3/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import re import sys import urllib2 diff --git a/moto/s3bucket_path/__init__.py b/moto/s3bucket_path/__init__.py index 6dd680be..fdeeaecb 100644 --- a/moto/s3bucket_path/__init__.py +++ b/moto/s3bucket_path/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import s3bucket_path_backend mock_s3bucket_path = s3bucket_path_backend.decorator diff --git a/moto/s3bucket_path/models.py b/moto/s3bucket_path/models.py index a32fe18e..ec991d9d 100644 --- a/moto/s3bucket_path/models.py +++ b/moto/s3bucket_path/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.s3.models import S3Backend diff --git a/moto/s3bucket_path/responses.py b/moto/s3bucket_path/responses.py index 0f54a1a1..4e2f8737 100644 --- a/moto/s3bucket_path/responses.py +++ b/moto/s3bucket_path/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .models import s3bucket_path_backend from .utils import bucket_name_from_url diff --git a/moto/s3bucket_path/urls.py b/moto/s3bucket_path/urls.py index 3d9d09ce..f37ab8cb 100644 --- a/moto/s3bucket_path/urls.py +++ b/moto/s3bucket_path/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import S3BucketPathResponseInstance as ro url_bases = [ diff --git a/moto/s3bucket_path/utils.py b/moto/s3bucket_path/utils.py index 97f1d40f..10101a7b 100644 --- a/moto/s3bucket_path/utils.py +++ b/moto/s3bucket_path/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import urlparse diff --git a/moto/server.py b/moto/server.py index a26a7d91..5549c672 100644 --- a/moto/server.py +++ b/moto/server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import re import sys import argparse diff --git a/moto/ses/__init__.py b/moto/ses/__init__.py index 77bc397f..3b0e93c1 100644 --- a/moto/ses/__init__.py +++ b/moto/ses/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import ses_backend mock_ses = ses_backend.decorator diff --git a/moto/ses/models.py b/moto/ses/models.py index ad80b159..c0355387 100644 --- a/moto/ses/models.py +++ b/moto/ses/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from moto.core import BaseBackend from .utils import get_random_message_id diff --git a/moto/ses/responses.py b/moto/ses/responses.py index a6c2d179..d25a223f 100644 --- a/moto/ses/responses.py +++ b/moto/ses/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/ses/urls.py b/moto/ses/urls.py index acdc49c8..73db50a5 100644 --- a/moto/ses/urls.py +++ b/moto/ses/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import EmailResponse url_bases = [ diff --git a/moto/ses/utils.py b/moto/ses/utils.py index 6501290a..e946e7cf 100644 --- a/moto/ses/utils.py +++ b/moto/ses/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import random import string diff --git a/moto/sns/__init__.py b/moto/sns/__init__.py index bc7150ad..f64c5e13 100644 --- a/moto/sns/__init__.py +++ b/moto/sns/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import sns_backend mock_sns = sns_backend.decorator diff --git a/moto/sns/models.py b/moto/sns/models.py index 1435da8e..f2b1e708 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import datetime import requests import uuid diff --git a/moto/sns/responses.py b/moto/sns/responses.py index bd0fde2a..dc3735f6 100644 --- a/moto/sns/responses.py +++ b/moto/sns/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from moto.core.responses import BaseResponse diff --git a/moto/sns/urls.py b/moto/sns/urls.py index a066e263..8ed7cc23 100644 --- a/moto/sns/urls.py +++ b/moto/sns/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import SNSResponse url_bases = [ diff --git a/moto/sns/utils.py b/moto/sns/utils.py index 1a0ca8d0..92b76345 100644 --- a/moto/sns/utils.py +++ b/moto/sns/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import uuid diff --git a/moto/sqs/__init__.py b/moto/sqs/__init__.py index e04391a3..2b934b6c 100644 --- a/moto/sqs/__init__.py +++ b/moto/sqs/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import sqs_backend mock_sqs = sqs_backend.decorator diff --git a/moto/sqs/exceptions.py b/moto/sqs/exceptions.py index dd1d897b..a6367827 100644 --- a/moto/sqs/exceptions.py +++ b/moto/sqs/exceptions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals class MessageNotInflight(Exception): description = "The message referred to is not in flight." status_code = 400 diff --git a/moto/sqs/models.py b/moto/sqs/models.py index 1338d75e..0299f479 100644 --- a/moto/sqs/models.py +++ b/moto/sqs/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import base64 import hashlib import time diff --git a/moto/sqs/responses.py b/moto/sqs/responses.py index 5e832193..1219e678 100644 --- a/moto/sqs/responses.py +++ b/moto/sqs/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/sqs/urls.py b/moto/sqs/urls.py index bbc6a273..ad973a3e 100644 --- a/moto/sqs/urls.py +++ b/moto/sqs/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import QueueResponse, QueuesResponse url_bases = [ diff --git a/moto/sqs/utils.py b/moto/sqs/utils.py index 6ea28736..ef3e77b2 100644 --- a/moto/sqs/utils.py +++ b/moto/sqs/utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import datetime import random import string diff --git a/moto/sts/__init__.py b/moto/sts/__init__.py index f1ca24c7..04e93e2e 100644 --- a/moto/sts/__init__.py +++ b/moto/sts/__init__.py @@ -1,2 +1,3 @@ +from __future__ import unicode_literals from .models import sts_backend mock_sts = sts_backend.decorator diff --git a/moto/sts/models.py b/moto/sts/models.py index f70c5917..3ea6cbd0 100644 --- a/moto/sts/models.py +++ b/moto/sts/models.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import datetime from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime diff --git a/moto/sts/responses.py b/moto/sts/responses.py index 5472fd07..e1430555 100644 --- a/moto/sts/responses.py +++ b/moto/sts/responses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from jinja2 import Template from moto.core.responses import BaseResponse diff --git a/moto/sts/urls.py b/moto/sts/urls.py index ab69fe8c..0efe3597 100644 --- a/moto/sts/urls.py +++ b/moto/sts/urls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from .responses import TokenResponse url_bases = [ diff --git a/setup.py b/setup.py index ea4e2e65..7eb55674 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python - +from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..baffc488 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/tests/backport_assert_raises.py b/tests/backport_assert_raises.py index a6d1faa8..75f9f342 100644 --- a/tests/backport_assert_raises.py +++ b/tests/backport_assert_raises.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals """ Patch courtesy of: https://marmida.com/blog/index.php/2012/08/08/monkey-patching-assert_raises/ @@ -5,14 +6,14 @@ https://marmida.com/blog/index.php/2012/08/08/monkey-patching-assert_raises/ # code for monkey-patching import nose.tools - + # let's fix nose.tools.assert_raises (which is really unittest.assertRaises) # so that it always supports context management - + # in order for these changes to be available to other modules, you'll need # to guarantee this module is imported by your fixture before either nose or # unittest are imported - + try: nose.tools.assert_raises(Exception) except TypeError: @@ -20,18 +21,18 @@ except TypeError: class AssertRaisesContext(object): def __init__(self, expected): self.expected = expected - + def __enter__(self): return self - + def __exit__(self, exc_type, exc_val, tb): self.exception = exc_val nose.tools.assert_equal(exc_type, self.expected) # if you get to this line, the last assertion must have passed # suppress the propagation of this exception return True - + def assert_raises_context(exc_type): return AssertRaisesContext(exc_type) - + nose.tools.assert_raises = assert_raises_context diff --git a/tests/helpers.py b/tests/helpers.py index 42bc3255..9ae8c18a 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from nose.plugins.skip import SkipTest diff --git a/tests/test_autoscaling/test_autoscaling.py b/tests/test_autoscaling/test_autoscaling.py index 1559569f..fa1881b7 100644 --- a/tests/test_autoscaling/test_autoscaling.py +++ b/tests/test_autoscaling/test_autoscaling.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.ec2.autoscale.launchconfig import LaunchConfiguration from boto.ec2.autoscale.group import AutoScalingGroup diff --git a/tests/test_autoscaling/test_launch_configurations.py b/tests/test_autoscaling/test_launch_configurations.py index 245adb55..60825d00 100644 --- a/tests/test_autoscaling/test_launch_configurations.py +++ b/tests/test_autoscaling/test_launch_configurations.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.ec2.autoscale.launchconfig import LaunchConfiguration from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping diff --git a/tests/test_autoscaling/test_policies.py b/tests/test_autoscaling/test_policies.py index 2f067151..8ca585e8 100644 --- a/tests/test_autoscaling/test_policies.py +++ b/tests/test_autoscaling/test_policies.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.ec2.autoscale.launchconfig import LaunchConfiguration from boto.ec2.autoscale.group import AutoScalingGroup diff --git a/tests/test_autoscaling/test_server.py b/tests/test_autoscaling/test_server.py index 72a38750..a116c77b 100644 --- a/tests/test_autoscaling/test_server.py +++ b/tests/test_autoscaling/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_cloudformation/__init__.py b/tests/test_cloudformation/__init__.py index e69de29b..baffc488 100644 --- a/tests/test_cloudformation/__init__.py +++ b/tests/test_cloudformation/__init__.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/tests/test_cloudformation/fixtures/__init__.py b/tests/test_cloudformation/fixtures/__init__.py index e69de29b..baffc488 100644 --- a/tests/test_cloudformation/fixtures/__init__.py +++ b/tests/test_cloudformation/fixtures/__init__.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/tests/test_cloudformation/fixtures/single_instance_with_ebs_volume.py b/tests/test_cloudformation/fixtures/single_instance_with_ebs_volume.py index 596b4939..37c7ca4f 100644 --- a/tests/test_cloudformation/fixtures/single_instance_with_ebs_volume.py +++ b/tests/test_cloudformation/fixtures/single_instance_with_ebs_volume.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + template = { "Description": "AWS CloudFormation Sample Template Gollum_Single_Instance_With_EBS_Volume: Gollum is a simple wiki system built on top of Git that powers GitHub Wikis. This template installs a Gollum Wiki stack on a single EC2 instance with an EBS volume for storage and demonstrates using the AWS CloudFormation bootstrap scripts to install the packages and files necessary at instance launch time. **WARNING** This template creates an Amazon EC2 instance and an EBS volume. You will be billed for the AWS resources used if you create a stack from this template.", "Parameters": { diff --git a/tests/test_cloudformation/fixtures/vpc_single_instance_in_subnet.py b/tests/test_cloudformation/fixtures/vpc_single_instance_in_subnet.py index 78f2a82d..1f296cf0 100644 --- a/tests/test_cloudformation/fixtures/vpc_single_instance_in_subnet.py +++ b/tests/test_cloudformation/fixtures/vpc_single_instance_in_subnet.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + template = { "Description": "AWS CloudFormation Sample Template vpc_single_instance_in_subnet.template: Sample template showing how to create a VPC and add an EC2 instance with an Elastic IP address and a security group. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.", "Parameters": { diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud.py b/tests/test_cloudformation/test_cloudformation_stack_crud.py index 8f47e966..fdbe7481 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_crud.py +++ b/tests/test_cloudformation/test_cloudformation_stack_crud.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json import boto diff --git a/tests/test_cloudformation/test_cloudformation_stack_integration.py b/tests/test_cloudformation/test_cloudformation_stack_integration.py index 8afe0a8e..befb6adf 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_integration.py +++ b/tests/test_cloudformation/test_cloudformation_stack_integration.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json import boto diff --git a/tests/test_cloudformation/test_server.py b/tests/test_cloudformation/test_server.py index e69de29b..baffc488 100644 --- a/tests/test_cloudformation/test_server.py +++ b/tests/test_cloudformation/test_server.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/tests/test_cloudformation/test_stack_parsing.py b/tests/test_cloudformation/test_stack_parsing.py index f517eb15..f6943952 100644 --- a/tests/test_cloudformation/test_stack_parsing.py +++ b/tests/test_cloudformation/test_stack_parsing.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json from mock import patch diff --git a/tests/test_core/test_decorator_calls.py b/tests/test_core/test_decorator_calls.py index 444bae89..28e9e5d0 100644 --- a/tests/test_core/test_decorator_calls.py +++ b/tests/test_core/test_decorator_calls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.exception import EC2ResponseError import sure # noqa diff --git a/tests/test_core/test_instance_metadata.py b/tests/test_core/test_instance_metadata.py index e11e67b9..c1269922 100644 --- a/tests/test_core/test_instance_metadata.py +++ b/tests/test_core/test_instance_metadata.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import requests from moto import mock_ec2 diff --git a/tests/test_core/test_nested.py b/tests/test_core/test_nested.py index 9ae366a5..09967d74 100644 --- a/tests/test_core/test_nested.py +++ b/tests/test_core/test_nested.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import unittest from boto.sqs.connection import SQSConnection @@ -25,4 +26,4 @@ class TestNestedDecorators(unittest.TestCase): self.setup_sqs_queue() conn = EC2Connection() - conn.run_instances('ami-123456') \ No newline at end of file + conn.run_instances('ami-123456') diff --git a/tests/test_core/test_server.py b/tests/test_core/test_server.py index c59cdecf..9a92f9ea 100644 --- a/tests/test_core/test_server.py +++ b/tests/test_core/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from mock import patch import sure # noqa diff --git a/tests/test_core/test_url_mapping.py b/tests/test_core/test_url_mapping.py index 7218398e..4e4e19a3 100644 --- a/tests/test_core/test_url_mapping.py +++ b/tests/test_core/test_url_mapping.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa from moto.core.utils import convert_regex_to_flask_path diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py index ac95fb88..6c2b4e6e 100644 --- a/tests/test_dynamodb/test_dynamodb.py +++ b/tests/test_dynamodb/test_dynamodb.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa import requests diff --git a/tests/test_dynamodb/test_dynamodb_table_with_range_key.py b/tests/test_dynamodb/test_dynamodb_table_with_range_key.py index 38be4e49..065a2ab0 100644 --- a/tests/test_dynamodb/test_dynamodb_table_with_range_key.py +++ b/tests/test_dynamodb/test_dynamodb_table_with_range_key.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa from freezegun import freeze_time diff --git a/tests/test_dynamodb/test_dynamodb_table_without_range_key.py b/tests/test_dynamodb/test_dynamodb_table_without_range_key.py index 3e00fb97..112599ed 100644 --- a/tests/test_dynamodb/test_dynamodb_table_without_range_key.py +++ b/tests/test_dynamodb/test_dynamodb_table_without_range_key.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa from freezegun import freeze_time diff --git a/tests/test_dynamodb/test_server.py b/tests/test_dynamodb/test_server.py index 649f32a3..ca4ed614 100644 --- a/tests/test_dynamodb/test_server.py +++ b/tests/test_dynamodb/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_dynamodb2/test_dynamodb.py b/tests/test_dynamodb2/test_dynamodb.py index faf59ce3..ead25c01 100644 --- a/tests/test_dynamodb2/test_dynamodb.py +++ b/tests/test_dynamodb2/test_dynamodb.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa import requests @@ -13,10 +14,10 @@ except ImportError: @requires_boto_gte("2.9") @mock_dynamodb2 def test_list_tables(): - name = 'TestTable' - #{'schema': } + name = 'TestTable' + #{'schema': } dynamodb_backend2.create_table(name,schema=[ - {u'KeyType': u'HASH', u'AttributeName': u'forum_name'}, + {u'KeyType': u'HASH', u'AttributeName': u'forum_name'}, {u'KeyType': u'RANGE', u'AttributeName': u'subject'} ]) conn = boto.dynamodb2.connect_to_region( @@ -39,7 +40,7 @@ def test_list_tables_layer_1(): 'us-west-2', aws_access_key_id="ak", aws_secret_access_key="sk") - + res = conn.list_tables(limit=1) expected = {"TableNames": ["test_1"], "LastEvaluatedTableName": "test_1"} res.should.equal(expected) diff --git a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py index 92f5f0a5..8c027a2e 100644 --- a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py +++ b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa from freezegun import freeze_time diff --git a/tests/test_dynamodb2/test_dynamodb_table_without_range_key.py b/tests/test_dynamodb2/test_dynamodb_table_without_range_key.py index 429b3c0d..e85d1eef 100644 --- a/tests/test_dynamodb2/test_dynamodb_table_without_range_key.py +++ b/tests/test_dynamodb2/test_dynamodb_table_without_range_key.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa from freezegun import freeze_time diff --git a/tests/test_dynamodb2/test_server.py b/tests/test_dynamodb2/test_server.py index 49f2e681..35347cce 100644 --- a/tests/test_dynamodb2/test_server.py +++ b/tests/test_dynamodb2/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_ec2/test_amazon_dev_pay.py b/tests/test_ec2/test_amazon_dev_pay.py index e91f1f4f..38e1eb75 100644 --- a/tests/test_ec2/test_amazon_dev_pay.py +++ b/tests/test_ec2/test_amazon_dev_pay.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_amis.py b/tests/test_ec2/test_amis.py index 27201a2d..c5bd2251 100644 --- a/tests/test_ec2/test_amis.py +++ b/tests/test_ec2/test_amis.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_availability_zones_and_regions.py b/tests/test_ec2/test_availability_zones_and_regions.py index 3ac21bbc..f59bc20f 100644 --- a/tests/test_ec2/test_availability_zones_and_regions.py +++ b/tests/test_ec2/test_availability_zones_and_regions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_customer_gateways.py b/tests/test_ec2/test_customer_gateways.py index ef6645e4..80fddf28 100644 --- a/tests/test_ec2/test_customer_gateways.py +++ b/tests/test_ec2/test_customer_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_dhcp_options.py b/tests/test_ec2/test_dhcp_options.py index 4fd2eb94..cd2e0428 100644 --- a/tests/test_ec2/test_dhcp_options.py +++ b/tests/test_ec2/test_dhcp_options.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_ec2_core.py b/tests/test_ec2/test_ec2_core.py index 7a99a303..53c7d648 100644 --- a/tests/test_ec2/test_ec2_core.py +++ b/tests/test_ec2/test_ec2_core.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import requests from moto import mock_ec2 diff --git a/tests/test_ec2/test_elastic_block_store.py b/tests/test_ec2/test_elastic_block_store.py index 9971e79e..d7d9c6ac 100644 --- a/tests/test_ec2/test_elastic_block_store.py +++ b/tests/test_ec2/test_elastic_block_store.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_elastic_ip_addresses.py b/tests/test_ec2/test_elastic_ip_addresses.py index ebdbcbc2..ed7bb352 100644 --- a/tests/test_ec2/test_elastic_ip_addresses.py +++ b/tests/test_ec2/test_elastic_ip_addresses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_elastic_network_interfaces.py b/tests/test_ec2/test_elastic_network_interfaces.py index b158086f..49d4c81e 100644 --- a/tests/test_ec2/test_elastic_network_interfaces.py +++ b/tests/test_ec2/test_elastic_network_interfaces.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_general.py b/tests/test_ec2/test_general.py index b64b476d..83225bc0 100644 --- a/tests/test_ec2/test_general.py +++ b/tests/test_ec2/test_general.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py index 91b1ddc5..6dda215d 100644 --- a/tests/test_ec2/test_instances.py +++ b/tests/test_ec2/test_instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_internet_gateways.py b/tests/test_ec2/test_internet_gateways.py index 4c841e15..da1545f0 100644 --- a/tests/test_ec2/test_internet_gateways.py +++ b/tests/test_ec2/test_internet_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_ip_addresses.py b/tests/test_ec2/test_ip_addresses.py index 1a6c5e84..a8e927b0 100644 --- a/tests/test_ec2/test_ip_addresses.py +++ b/tests/test_ec2/test_ip_addresses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_key_pairs.py b/tests/test_ec2/test_key_pairs.py index 3319b82f..198a4643 100644 --- a/tests/test_ec2/test_key_pairs.py +++ b/tests/test_ec2/test_key_pairs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_monitoring.py b/tests/test_ec2/test_monitoring.py index 84f513f2..03be93ad 100644 --- a/tests/test_ec2/test_monitoring.py +++ b/tests/test_ec2/test_monitoring.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_network_acls.py b/tests/test_ec2/test_network_acls.py index 92f34e54..3fdd2f63 100644 --- a/tests/test_ec2/test_network_acls.py +++ b/tests/test_ec2/test_network_acls.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_placement_groups.py b/tests/test_ec2/test_placement_groups.py index 2be99684..c7494228 100644 --- a/tests/test_ec2/test_placement_groups.py +++ b/tests/test_ec2/test_placement_groups.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_regions.py b/tests/test_ec2/test_regions.py index a72412f0..153bb759 100644 --- a/tests/test_ec2/test_regions.py +++ b/tests/test_ec2/test_regions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto.ec2 import boto.ec2.autoscale import sure @@ -20,7 +21,7 @@ def test_add_servers_to_a_single_region(): reservations = conn.get_all_instances() len(reservations).should.equal(2) reservations.sort(key=lambda x: x.instances[0].image_id) - + reservations[0].instances[0].image_id.should.equal('ami-1234abcd') reservations[1].instances[0].image_id.should.equal('ami-5678efgh') @@ -39,7 +40,7 @@ def test_add_servers_to_multiple_regions(): len(us_reservations).should.equal(1) len(ap_reservations).should.equal(1) - + us_reservations[0].instances[0].image_id.should.equal('ami-1234abcd') ap_reservations[0].instances[0].image_id.should.equal('ami-5678efgh') @@ -129,4 +130,4 @@ def test_create_autoscaling_group(): ap_group.health_check_type.should.equal("EC2") list(ap_group.load_balancers).should.equal(["ap_test_lb"]) ap_group.placement_group.should.equal("ap_test_placement") - list(ap_group.termination_policies).should.equal(["OldestInstance", "NewestInstance"]) \ No newline at end of file + list(ap_group.termination_policies).should.equal(["OldestInstance", "NewestInstance"]) diff --git a/tests/test_ec2/test_reserved_instances.py b/tests/test_ec2/test_reserved_instances.py index fdb80bc6..437d3a95 100644 --- a/tests/test_ec2/test_reserved_instances.py +++ b/tests/test_ec2/test_reserved_instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_route_tables.py b/tests/test_ec2/test_route_tables.py index 3d376961..19434129 100644 --- a/tests/test_ec2/test_route_tables.py +++ b/tests/test_ec2/test_route_tables.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_security_groups.py b/tests/test_ec2/test_security_groups.py index 6b5f4033..c624922c 100644 --- a/tests/test_ec2/test_security_groups.py +++ b/tests/test_ec2/test_security_groups.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_server.py b/tests/test_ec2/test_server.py index 8e630f7e..9d0c9dce 100644 --- a/tests/test_ec2/test_server.py +++ b/tests/test_ec2/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import re import sure # noqa diff --git a/tests/test_ec2/test_spot_instances.py b/tests/test_ec2/test_spot_instances.py index 46a5d713..66e68e69 100644 --- a/tests/test_ec2/test_spot_instances.py +++ b/tests/test_ec2/test_spot_instances.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import datetime import boto diff --git a/tests/test_ec2/test_subnets.py b/tests/test_ec2/test_subnets.py index 37fd4007..c2626740 100644 --- a/tests/test_ec2/test_subnets.py +++ b/tests/test_ec2/test_subnets.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_tags.py b/tests/test_ec2/test_tags.py index 1138b5e9..7a775caa 100644 --- a/tests/test_ec2/test_tags.py +++ b/tests/test_ec2/test_tags.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import itertools import boto diff --git a/tests/test_ec2/test_virtual_private_gateways.py b/tests/test_ec2/test_virtual_private_gateways.py index b9fa80a6..eea1e222 100644 --- a/tests/test_ec2/test_virtual_private_gateways.py +++ b/tests/test_ec2/test_virtual_private_gateways.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_vm_export.py b/tests/test_ec2/test_vm_export.py index 478372b7..f8b24f6d 100644 --- a/tests/test_ec2/test_vm_export.py +++ b/tests/test_ec2/test_vm_export.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_vm_import.py b/tests/test_ec2/test_vm_import.py index 0c310fc5..66c7561a 100644 --- a/tests/test_ec2/test_vm_import.py +++ b/tests/test_ec2/test_vm_import.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_vpc_peering.py b/tests/test_ec2/test_vpc_peering.py index d67402ef..d41c3ab7 100644 --- a/tests/test_ec2/test_vpc_peering.py +++ b/tests/test_ec2/test_vpc_peering.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_vpcs.py b/tests/test_ec2/test_vpcs.py index 952dae34..c121d0a5 100644 --- a/tests/test_ec2/test_vpcs.py +++ b/tests/test_ec2/test_vpcs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises diff --git a/tests/test_ec2/test_vpn_connections.py b/tests/test_ec2/test_vpn_connections.py index 4ce1e398..06b9fba5 100644 --- a/tests/test_ec2/test_vpn_connections.py +++ b/tests/test_ec2/test_vpn_connections.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_ec2/test_windows.py b/tests/test_ec2/test_windows.py index 92f3be6a..364ac2f8 100644 --- a/tests/test_ec2/test_windows.py +++ b/tests/test_ec2/test_windows.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_elb/test_elb.py b/tests/test_elb/test_elb.py index 4e74701d..5e2377cf 100644 --- a/tests/test_elb/test_elb.py +++ b/tests/test_elb/test_elb.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.ec2.elb import HealthCheck import sure # noqa diff --git a/tests/test_elb/test_server.py b/tests/test_elb/test_server.py index c8f13e8d..50dacbcf 100644 --- a/tests/test_elb/test_server.py +++ b/tests/test_elb/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_emr/test_emr.py b/tests/test_emr/test_emr.py index eb17c37a..dd72b54b 100644 --- a/tests/test_emr/test_emr.py +++ b/tests/test_emr/test_emr.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.emr.instance_group import InstanceGroup from boto.emr.step import StreamingStep diff --git a/tests/test_emr/test_server.py b/tests/test_emr/test_server.py index 07aed3bc..68cb2380 100644 --- a/tests/test_emr/test_server.py +++ b/tests/test_emr/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_iam/test_iam.py b/tests/test_iam/test_iam.py index 93628668..e950b7b8 100644 --- a/tests/test_iam/test_iam.py +++ b/tests/test_iam/test_iam.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_route53/test_route53.py b/tests/test_route53/test_route53.py index c58b27da..a495087a 100644 --- a/tests/test_route53/test_route53.py +++ b/tests/test_route53/test_route53.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import urllib2 import boto diff --git a/tests/test_s3/test_s3.py b/tests/test_s3/test_s3.py index f5eb6888..1fa7909a 100644 --- a/tests/test_s3/test_s3.py +++ b/tests/test_s3/test_s3.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import urllib2 from io import BytesIO diff --git a/tests/test_s3/test_s3_utils.py b/tests/test_s3/test_s3_utils.py index d2eee840..3b1d4a01 100644 --- a/tests/test_s3/test_s3_utils.py +++ b/tests/test_s3/test_s3_utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from sure import expect from moto.s3.utils import bucket_name_from_url, _VersionedKeyStore diff --git a/tests/test_s3/test_server.py b/tests/test_s3/test_server.py index 18e12394..0108ea65 100644 --- a/tests/test_s3/test_server.py +++ b/tests/test_s3/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_s3bucket_path/test_bucket_path_server.py b/tests/test_s3bucket_path/test_bucket_path_server.py index 387f6cf0..a53c6e52 100644 --- a/tests/test_s3bucket_path/test_bucket_path_server.py +++ b/tests/test_s3bucket_path/test_bucket_path_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_s3bucket_path/test_s3bucket_path.py b/tests/test_s3bucket_path/test_s3bucket_path.py index 5501aea3..f57ba4ca 100644 --- a/tests/test_s3bucket_path/test_s3bucket_path.py +++ b/tests/test_s3bucket_path/test_s3bucket_path.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import urllib2 import boto diff --git a/tests/test_s3bucket_path/test_s3bucket_path_utils.py b/tests/test_s3bucket_path/test_s3bucket_path_utils.py index 4b9ff30b..8497f818 100644 --- a/tests/test_s3bucket_path/test_s3bucket_path_utils.py +++ b/tests/test_s3bucket_path/test_s3bucket_path_utils.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from sure import expect from moto.s3bucket_path.utils import bucket_name_from_url diff --git a/tests/test_ses/test_server.py b/tests/test_ses/test_server.py index 06a71d13..94b1d93f 100644 --- a/tests/test_ses/test_server.py +++ b/tests/test_ses/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_ses/test_ses.py b/tests/test_ses/test_ses.py index 6b8f357d..43d81879 100644 --- a/tests/test_ses/test_ses.py +++ b/tests/test_ses/test_ses.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import email import boto @@ -54,7 +55,7 @@ def test_send_email(): send_quota = conn.get_send_quota() sent_count = int(send_quota['GetSendQuotaResponse']['GetSendQuotaResult']['SentLast24Hours']) sent_count.should.equal(1) - + @mock_ses def test_send_html_email(): conn = boto.connect_ses('the_key', 'the_secret') diff --git a/tests/test_sns/test_publishing.py b/tests/test_sns/test_publishing.py index 9a3ff839..40285a9c 100644 --- a/tests/test_sns/test_publishing.py +++ b/tests/test_sns/test_publishing.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from urlparse import parse_qs import boto diff --git a/tests/test_sns/test_server.py b/tests/test_sns/test_server.py index e69de29b..baffc488 100644 --- a/tests/test_sns/test_server.py +++ b/tests/test_sns/test_server.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/tests/test_sns/test_subscriptions.py b/tests/test_sns/test_subscriptions.py index 8aa2b158..4fc14ffe 100644 --- a/tests/test_sns/test_subscriptions.py +++ b/tests/test_sns/test_subscriptions.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_sns/test_topics.py b/tests/test_sns/test_topics.py index d7a8c577..b95ec0f7 100644 --- a/tests/test_sns/test_topics.py +++ b/tests/test_sns/test_topics.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto import sure # noqa diff --git a/tests/test_sqs/test_server.py b/tests/test_sqs/test_server.py index 2a098150..36362540 100644 --- a/tests/test_sqs/test_server.py +++ b/tests/test_sqs/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import re import sure # noqa diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py index 20524977..5362535d 100644 --- a/tests/test_sqs/test_sqs.py +++ b/tests/test_sqs/test_sqs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import boto from boto.exception import SQSError from boto.sqs.message import RawMessage diff --git a/tests/test_sts/test_server.py b/tests/test_sts/test_server.py index 5e57f56e..92d5beae 100644 --- a/tests/test_sts/test_server.py +++ b/tests/test_sts/test_server.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import sure # noqa import moto.server as server diff --git a/tests/test_sts/test_sts.py b/tests/test_sts/test_sts.py index 04f37292..dbc0bc43 100644 --- a/tests/test_sts/test_sts.py +++ b/tests/test_sts/test_sts.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import json import boto