This commit is contained in:
Steve Pulec 2013-03-05 08:35:18 -05:00
commit e993917d4c
57 changed files with 53 additions and 71 deletions

View file

@ -1,6 +1,6 @@
import boto
from boto.exception import EC2ResponseError
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2
@ -36,4 +36,4 @@ def test_decorator_start_and_stop():
list(conn.get_all_instances()).should.equal([])
mock.stop()
expect(conn.get_all_instances.when.called_with()).should.throw(EC2ResponseError)
conn.get_all_instances.when.called_with().should.throw(EC2ResponseError)

View file

@ -17,7 +17,8 @@ def test_list_tables():
@freeze_time("2012-01-14")
@mock_dynamodb
def test_describe_table():
dynamodb_backend.create_table('messages',
dynamodb_backend.create_table(
'messages',
hash_key_attr='forum_name',
hash_key_type='S',
range_key_attr='subject',

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,7 +1,7 @@
import boto
from boto.exception import EC2ResponseError
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2
@ -36,4 +36,4 @@ def test_ami_pulls_attributes_from_instance():
image_id = conn.create_image(instance.id, "test-ami", "this is a test ami")
image = conn.get_image(image_id)
expect(image.kernel_id).should.equal('test-kernel')
image.kernel_id.should.equal('test-kernel')

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -4,5 +4,7 @@ from moto import mock_ec2
@mock_ec2
def test_not_implemented_method():
requests.post.when.called_with("https://ec2.us-east-1.amazonaws.com/",
data={'Action': ['foobar']}).should.throw(NotImplementedError)
requests.post.when.called_with(
"https://ec2.us-east-1.amazonaws.com/",
data={'Action': ['foobar']}
).should.throw(NotImplementedError)

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,6 +1,6 @@
import boto
from boto.exception import EC2ResponseError
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2
@ -10,7 +10,7 @@ def test_create_and_describe_security_group():
conn = boto.connect_ec2('the_key', 'the_secret')
security_group = conn.create_security_group('test security group', 'this is a test security group')
expect(security_group.name).should.equal('test security group')
security_group.name.should.equal('test security group')
security_group.description.should.equal('this is a test security group')
# Trying to create another group with the same name should throw an error

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -1,5 +1,5 @@
import boto
from sure import expect
import sure # flake8: noqa
from moto import mock_ec2

View file

@ -5,7 +5,7 @@ from boto.exception import S3ResponseError
from boto.s3.key import Key
import requests
from sure import expect
import sure # flake8: noqa
from moto import mock_s3
@ -33,7 +33,7 @@ def test_my_model_save():
model_instance = MyModel('steve', 'is awesome')
model_instance.save()
expect(conn.get_bucket('mybucket').get_key('steve').get_contents_as_string()).should.equal('is awesome')
conn.get_bucket('mybucket').get_key('steve').get_contents_as_string().should.equal('is awesome')
@mock_s3

View file

@ -3,7 +3,7 @@ import email
import boto
from boto.exception import BotoServerError
from sure import expect
import sure # flake8: noqa
from moto import mock_ses

View file

@ -1,7 +1,7 @@
import boto
from boto.exception import SQSError
import requests
from sure import expect
import sure # flake8: noqa
from moto import mock_sqs
@ -12,7 +12,7 @@ def test_create_queue():
conn.create_queue("test-queue", visibility_timeout=60)
all_queues = conn.get_all_queues()
expect(all_queues[0].name).should.equal("test-queue")
all_queues[0].name.should.equal("test-queue")
all_queues[0].get_timeout().should.equal(60)