from __future__ import unicode_literals
This commit is contained in:
parent
b69179818c
commit
4201e6b430
196 changed files with 219 additions and 19 deletions
|
|
@ -0,0 +1 @@
|
|||
from __future__ import unicode_literals
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
from nose.plugins.skip import SkipTest
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
from __future__ import unicode_literals
|
||||
|
|
@ -0,0 +1 @@
|
|||
from __future__ import unicode_literals
|
||||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import json
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import json
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
from __future__ import unicode_literals
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import json
|
||||
|
||||
from mock import patch
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
from boto.exception import EC2ResponseError
|
||||
import sure # noqa
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import requests
|
||||
|
||||
from moto import mock_ec2
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
conn.run_instances('ami-123456')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from mock import patch
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
from moto.core.utils import convert_regex_to_flask_path
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
import requests
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
from freezegun import freeze_time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import requests
|
||||
from moto import mock_ec2
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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"])
|
||||
list(ap_group.termination_policies).should.equal(["OldestInstance", "NewestInstance"])
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import re
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import datetime
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import itertools
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
from boto.ec2.elb import HealthCheck
|
||||
import sure # noqa
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
from boto.emr.instance_group import InstanceGroup
|
||||
from boto.emr.step import StreamingStep
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
|
||||
import sure # noqa
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import urllib2
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import urllib2
|
||||
from io import BytesIO
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from sure import expect
|
||||
from moto.s3.utils import bucket_name_from_url, _VersionedKeyStore
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import urllib2
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from sure import expect
|
||||
from moto.s3bucket_path.utils import bucket_name_from_url
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from urlparse import parse_qs
|
||||
|
||||
import boto
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
from __future__ import unicode_literals
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
|
||||
import sure # noqa
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
|
||||
import sure # noqa
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import re
|
||||
import sure # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
from boto.exception import SQSError
|
||||
from boto.sqs.message import RawMessage
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import sure # noqa
|
||||
|
||||
import moto.server as server
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import json
|
||||
|
||||
import boto
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue