From 4201e6b430e74d45e0c1f84b094575285429b0bb Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 27 Aug 2014 11:17:06 -0400 Subject: [PATCH] from __future__ import unicode_literals --- moto/__init__.py | 1 + moto/autoscaling/__init__.py | 1 + moto/autoscaling/models.py | 1 + moto/autoscaling/responses.py | 1 + moto/autoscaling/urls.py | 1 + moto/backends.py | 1 + moto/cloudformation/__init__.py | 1 + moto/cloudformation/models.py | 1 + moto/cloudformation/parsing.py | 1 + moto/cloudformation/responses.py | 1 + moto/cloudformation/urls.py | 1 + moto/cloudformation/utils.py | 1 + moto/core/__init__.py | 1 + moto/core/models.py | 1 + moto/core/responses.py | 1 + moto/core/utils.py | 1 + moto/dynamodb/__init__.py | 1 + moto/dynamodb/comparisons.py | 1 + moto/dynamodb/models.py | 1 + moto/dynamodb/responses.py | 1 + moto/dynamodb/urls.py | 1 + moto/dynamodb/utils.py | 1 + moto/dynamodb2/__init__.py | 1 + moto/dynamodb2/comparisons.py | 1 + moto/dynamodb2/models.py | 1 + moto/dynamodb2/responses.py | 1 + moto/dynamodb2/urls.py | 1 + moto/dynamodb2/utils.py | 1 + moto/ec2/__init__.py | 1 + moto/ec2/exceptions.py | 1 + moto/ec2/models.py | 1 + moto/ec2/responses/__init__.py | 2 ++ moto/ec2/responses/amazon_dev_pay.py | 1 + moto/ec2/responses/amis.py | 1 + .../responses/availability_zones_and_regions.py | 1 + moto/ec2/responses/customer_gateways.py | 1 + moto/ec2/responses/dhcp_options.py | 1 + moto/ec2/responses/elastic_block_store.py | 1 + moto/ec2/responses/elastic_ip_addresses.py | 1 + moto/ec2/responses/elastic_network_interfaces.py | 1 + moto/ec2/responses/general.py | 1 + moto/ec2/responses/instances.py | 1 + moto/ec2/responses/internet_gateways.py | 1 + moto/ec2/responses/ip_addresses.py | 1 + moto/ec2/responses/key_pairs.py | 5 +++-- moto/ec2/responses/monitoring.py | 1 + moto/ec2/responses/network_acls.py | 1 + moto/ec2/responses/placement_groups.py | 1 + moto/ec2/responses/reserved_instances.py | 1 + moto/ec2/responses/route_tables.py | 1 + moto/ec2/responses/security_groups.py | 1 + moto/ec2/responses/spot_instances.py | 1 + moto/ec2/responses/subnets.py | 1 + moto/ec2/responses/tags.py | 1 + moto/ec2/responses/virtual_private_gateways.py | 1 + moto/ec2/responses/vm_export.py | 1 + moto/ec2/responses/vm_import.py | 1 + moto/ec2/responses/vpc_peering_connections.py | 1 + moto/ec2/responses/vpcs.py | 1 + moto/ec2/responses/vpn_connections.py | 1 + moto/ec2/responses/windows.py | 1 + moto/ec2/urls.py | 1 + moto/ec2/utils.py | 1 + moto/elb/__init__.py | 1 + moto/elb/models.py | 1 + moto/elb/responses.py | 1 + moto/elb/urls.py | 1 + moto/emr/__init__.py | 1 + moto/emr/models.py | 1 + moto/emr/responses.py | 1 + moto/emr/urls.py | 1 + moto/emr/utils.py | 1 + moto/iam/__init__.py | 1 + moto/iam/models.py | 1 + moto/iam/responses.py | 1 + moto/iam/urls.py | 1 + moto/iam/utils.py | 1 + moto/route53/__init__.py | 1 + moto/route53/models.py | 1 + moto/route53/responses.py | 1 + moto/route53/urls.py | 1 + moto/s3/__init__.py | 1 + moto/s3/exceptions.py | 3 +++ moto/s3/models.py | 1 + moto/s3/responses.py | 1 + moto/s3/urls.py | 1 + moto/s3/utils.py | 1 + moto/s3bucket_path/__init__.py | 1 + moto/s3bucket_path/models.py | 1 + moto/s3bucket_path/responses.py | 1 + moto/s3bucket_path/urls.py | 1 + moto/s3bucket_path/utils.py | 1 + moto/server.py | 1 + moto/ses/__init__.py | 1 + moto/ses/models.py | 1 + moto/ses/responses.py | 1 + moto/ses/urls.py | 1 + moto/ses/utils.py | 1 + moto/sns/__init__.py | 1 + moto/sns/models.py | 1 + moto/sns/responses.py | 1 + moto/sns/urls.py | 1 + moto/sns/utils.py | 1 + moto/sqs/__init__.py | 1 + moto/sqs/exceptions.py | 1 + moto/sqs/models.py | 1 + moto/sqs/responses.py | 1 + moto/sqs/urls.py | 1 + moto/sqs/utils.py | 1 + moto/sts/__init__.py | 1 + moto/sts/models.py | 1 + moto/sts/responses.py | 1 + moto/sts/urls.py | 1 + setup.py | 2 +- tests/__init__.py | 1 + tests/backport_assert_raises.py | 15 ++++++++------- tests/helpers.py | 1 + tests/test_autoscaling/test_autoscaling.py | 1 + .../test_launch_configurations.py | 1 + tests/test_autoscaling/test_policies.py | 1 + tests/test_autoscaling/test_server.py | 1 + tests/test_cloudformation/__init__.py | 1 + tests/test_cloudformation/fixtures/__init__.py | 1 + .../fixtures/single_instance_with_ebs_volume.py | 2 ++ .../fixtures/vpc_single_instance_in_subnet.py | 2 ++ .../test_cloudformation_stack_crud.py | 1 + .../test_cloudformation_stack_integration.py | 1 + tests/test_cloudformation/test_server.py | 1 + tests/test_cloudformation/test_stack_parsing.py | 1 + tests/test_core/test_decorator_calls.py | 1 + tests/test_core/test_instance_metadata.py | 1 + tests/test_core/test_nested.py | 3 ++- tests/test_core/test_server.py | 1 + tests/test_core/test_url_mapping.py | 1 + tests/test_dynamodb/test_dynamodb.py | 1 + .../test_dynamodb_table_with_range_key.py | 1 + .../test_dynamodb_table_without_range_key.py | 1 + tests/test_dynamodb/test_server.py | 1 + tests/test_dynamodb2/test_dynamodb.py | 9 +++++---- .../test_dynamodb_table_with_range_key.py | 1 + .../test_dynamodb_table_without_range_key.py | 1 + tests/test_dynamodb2/test_server.py | 1 + tests/test_ec2/test_amazon_dev_pay.py | 1 + tests/test_ec2/test_amis.py | 1 + .../test_availability_zones_and_regions.py | 1 + tests/test_ec2/test_customer_gateways.py | 1 + tests/test_ec2/test_dhcp_options.py | 1 + tests/test_ec2/test_ec2_core.py | 1 + tests/test_ec2/test_elastic_block_store.py | 1 + tests/test_ec2/test_elastic_ip_addresses.py | 1 + tests/test_ec2/test_elastic_network_interfaces.py | 1 + tests/test_ec2/test_general.py | 1 + tests/test_ec2/test_instances.py | 1 + tests/test_ec2/test_internet_gateways.py | 1 + tests/test_ec2/test_ip_addresses.py | 1 + tests/test_ec2/test_key_pairs.py | 1 + tests/test_ec2/test_monitoring.py | 1 + tests/test_ec2/test_network_acls.py | 1 + tests/test_ec2/test_placement_groups.py | 1 + tests/test_ec2/test_regions.py | 7 ++++--- tests/test_ec2/test_reserved_instances.py | 1 + tests/test_ec2/test_route_tables.py | 1 + tests/test_ec2/test_security_groups.py | 1 + tests/test_ec2/test_server.py | 1 + tests/test_ec2/test_spot_instances.py | 1 + tests/test_ec2/test_subnets.py | 1 + tests/test_ec2/test_tags.py | 1 + tests/test_ec2/test_virtual_private_gateways.py | 1 + tests/test_ec2/test_vm_export.py | 1 + tests/test_ec2/test_vm_import.py | 1 + tests/test_ec2/test_vpc_peering.py | 1 + tests/test_ec2/test_vpcs.py | 1 + tests/test_ec2/test_vpn_connections.py | 1 + tests/test_ec2/test_windows.py | 1 + tests/test_elb/test_elb.py | 1 + tests/test_elb/test_server.py | 1 + tests/test_emr/test_emr.py | 1 + tests/test_emr/test_server.py | 1 + tests/test_iam/test_iam.py | 1 + tests/test_route53/test_route53.py | 1 + tests/test_s3/test_s3.py | 1 + tests/test_s3/test_s3_utils.py | 1 + tests/test_s3/test_server.py | 1 + .../test_s3bucket_path/test_bucket_path_server.py | 1 + tests/test_s3bucket_path/test_s3bucket_path.py | 1 + .../test_s3bucket_path_utils.py | 1 + tests/test_ses/test_server.py | 1 + tests/test_ses/test_ses.py | 3 ++- tests/test_sns/test_publishing.py | 1 + tests/test_sns/test_server.py | 1 + tests/test_sns/test_subscriptions.py | 1 + tests/test_sns/test_topics.py | 1 + tests/test_sqs/test_server.py | 1 + tests/test_sqs/test_sqs.py | 1 + tests/test_sts/test_server.py | 1 + tests/test_sts/test_sts.py | 1 + 196 files changed, 219 insertions(+), 19 deletions(-) diff --git a/moto/__init__.py b/moto/__init__.py index 8aa959cff..fa1fa6ec0 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 b1df21694..ecd82ab0b 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 6571c97db..0a7ae0e75 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 1b893e424..36ce758f7 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 affa69c96..336cade3f 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 ed237401a..46f932d3f 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 45726c8b2..17d520ba7 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 50d06fc19..20672f5a6 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 797743979..2f800f7c6 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 ef31670ae..23d0be777 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 4d4c0ddb6..f2cfb0205 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 e7f5e98c5..09cffd6a0 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 4bf815e7b..7e8c31109 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 7460d2d93..ec77d50f1 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 4c346b173..1c76aa247 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 9926a2a36..280248780 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 3312203f5..6f2509f79 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 58fa43c43..86f582179 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 f49607023..be009ede5 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 b2cc29e8c..742f17f0c 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 6ed5e00d5..1afd34354 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 5ca887da6..1adee245b 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 db523803b..8579c48df 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 58fa43c43..86f582179 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 3a330ef17..af44569df 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 8f90e8b04..94a7da4f1 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 6ed5e00d5..1afd34354 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 5ca887da6..1adee245b 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 dc34e5f69..649c8737a 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 133a11adb..4a2b2a6d2 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 df15b7f10..52cb62005 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 13b6ce017..f051a7ca7 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 d0ef8893b..af10a8d68 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 4dcb0a246..a78a4928c 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 1e1b482aa..a47d9a496 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 1f30a9d16..150ed755b 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 4fb127d68..09e535c80 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 bd88c559a..9d48f0e89 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 afd47498b..7169eb854 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 985fc334c..596b2be9f 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 721aaaeb0..2e5514911 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 b4b3bedb7..a420e28d8 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 9309baaeb..1e60f7cbe 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 7d79d2a75..1a242211d 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 883251994..a57686d24 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 40a2a7434..ebb99cf8e 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 56ac36c38..c0978c30d 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 2260b8852..2d23239d7 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 bab7967fd..d0fbbb988 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 b9dcfcceb..3b76a156d 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 c848c0a01..d61006dad 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 c05077407..fd848093c 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 d427228d5..64d34a5d5 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 6a12cf00c..ab0c6e4ca 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 e2bdac7db..18e1e99f1 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 8a88a709d..98c3dd3ea 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 a30cf706c..ea88bdc98 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 8fbefa314..3b1c7424f 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 609df6257..bdb3fe84a 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 61c34336b..ad947efec 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 809c82a1c..0a5e31a0e 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 65413369d..e27689087 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 77dce0d1e..bb4532dbf 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 fcadac99e..fbee07220 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 6a6bc6f6f..0f3da0fa3 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 8f92a9142..1e777bec0 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 e41ed2921..ee7703ff1 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 7d4de9a5f..ad7c75964 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 6c2045622..26e8f2a65 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 c4636ea81..c3bcab96b 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 8919362f7..0daa41e0d 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 88777fa30..c78b9772e 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 72e751fce..483969e19 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 440c32c60..e949cf173 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 d8f6fb410..35f1ad09b 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 f5dbfe75b..8c05a6f0e 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 64facde4d..c7e76f7bf 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 6448c3c39..2c6bd223f 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 1b2067504..f825ba160 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 598591d6a..40f38cb69 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 7b76e6b23..f336b9be5 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 4cb22ffc2..6590d4324 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 6633c62d3..52d8faced 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 b224fbe21..d433fd34f 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 027735261..d704a6f66 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 cfd673b2b..c775d02c7 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 0fecfb2c8..3f4ab1d6e 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 6dd680bed..fdeeaecb8 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 a32fe18e6..ec991d9d4 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 0f54a1a1d..4e2f87376 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 3d9d09cea..f37ab8cb7 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 97f1d40f1..10101a7b7 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 a26a7d913..5549c6725 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 77bc397fb..3b0e93c14 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 ad80b1596..c0355387d 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 a6c2d1790..d25a223f4 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 acdc49c82..73db50a52 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 6501290a4..e946e7cf4 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 bc7150ad4..f64c5e133 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 1435da8ed..f2b1e7085 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 bd0fde2a0..dc3735f6b 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 a066e263e..8ed7cc234 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 1a0ca8d01..92b76345a 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 e04391a39..2b934b6c7 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 dd1d897b5..a6367827c 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 1338d75e7..0299f479c 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 5e8321930..1219e6789 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 bbc6a2733..ad973a3e4 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 6ea287366..ef3e77b2a 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 f1ca24c7f..04e93e2e7 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 f70c59179..3ea6cbd05 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 5472fd074..e14305556 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 ab69fe8c2..0efe35979 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 ea4e2e652..7eb556747 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 e69de29bb..baffc4882 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 a6d1faa8a..75f9f342e 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 42bc3255e..9ae8c18a0 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 1559569f5..fa1881b7e 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 245adb559..60825d007 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 2f067151a..8ca585e89 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 72a38750d..a116c77b4 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 e69de29bb..baffc4882 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 e69de29bb..baffc4882 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 596b49391..37c7ca4f3 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 78f2a82d5..1f296cf0c 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 8f47e9665..fdbe7481b 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 8afe0a8ec..befb6adf8 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 e69de29bb..baffc4882 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 f517eb153..f6943952e 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 444bae89d..28e9e5d04 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 e11e67b94..c12699220 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 9ae366a50..09967d743 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 c59cdecf6..9a92f9ea4 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 7218398e2..4e4e19a3a 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 ac95fb88b..6c2b4e6ea 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 38be4e493..065a2ab09 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 3e00fb979..112599ed0 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 649f32a31..ca4ed6145 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 faf59ce32..ead25c018 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 92f5f0a5d..8c027a2e2 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 429b3c0dd..e85d1eefa 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 49f2e6819..35347cce4 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 e91f1f4f3..38e1eb751 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 27201a2d1..c5bd22510 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 3ac21bbc3..f59bc20fe 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 ef6645e40..80fddf287 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 4fd2eb946..cd2e04285 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 7a99a3034..53c7d6480 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 9971e79e5..d7d9c6ace 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 ebdbcbc2f..ed7bb352c 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 b158086fa..49d4c81e5 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 b64b476d5..83225bc0e 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 91b1ddc53..6dda215d7 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 4c841e157..da1545f09 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 1a6c5e84c..a8e927b00 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 3319b82ff..198a4643d 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 84f513f21..03be93adf 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 92f34e54f..3fdd2f630 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 2be996840..c7494228a 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 a72412f0e..153bb759a 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 fdb80bc63..437d3a95b 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 3d376961f..19434129e 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 6b5f4033d..c624922ca 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 8e630f7e2..9d0c9dce2 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 46a5d7136..66e68e695 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 37fd4007e..c26267405 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 1138b5e9f..7a775caa8 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 b9fa80a65..eea1e2222 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 478372b78..f8b24f6d4 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 0c310fc5b..66c7561a7 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 d67402ef5..d41c3ab7b 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 952dae34d..c121d0a52 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 4ce1e398e..06b9fba5e 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 92f3be6a4..364ac2f8a 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 4e74701da..5e2377cfd 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 c8f13e8d0..50dacbcfc 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 eb17c37ad..dd72b54b4 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 07aed3bc5..68cb23801 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 936286680..e950b7b89 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 c58b27da9..a495087ae 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 f5eb6888a..1fa7909a2 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 d2eee8402..3b1d4a01a 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 18e123940..0108ea65f 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 387f6cf0b..a53c6e523 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 5501aea3f..f57ba4ca8 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 4b9ff30b1..8497f8184 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 06a71d137..94b1d93f5 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 6b8f357df..43d81879e 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 9a3ff8396..40285a9c2 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 e69de29bb..baffc4882 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 8aa2b1587..4fc14ffe5 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 d7a8c5775..b95ec0f76 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 2a098150a..363625403 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 20524977c..5362535d1 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 5e57f56e1..92d5beaed 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 04f37292d..dbc0bc439 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