Commit Graph

44 Commits

Author SHA1 Message Date
mickeypash
231b100057 Add test scaffold. Currently broken 2020-04-03 01:58:14 +01:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Don Kuntz
ce4059f6d9
Use a consistent owner id between EC2 resources
Previously there were a couple models which used different owner ids by
default, which could make tests relying on them fail if someone wasn't
expecting that. This change ensures a uniform owner id between
resources.
2019-07-22 21:50:09 -05:00
David
868d0107bf Autoscaling instance azs (#2030)
* Add instance AZ support in autoscaling

* Resolve py36-py27 format string error in test_autoscaling
2019-05-25 11:18:16 +01:00
Jeffery Smith
4a99dcddb2 Issue #2141 Adding owner-id to the filter for Snapshot (#2142)
* Adding owner-id to the filter for Snapshot
2019-05-25 10:34:59 +01:00
Tay Frost
15b3ede3cc Add test for case where ebs volume has no tags.
This commit adds a test for a case where an EBS volume has no tags. When
an EBS volume has no tags, calls to the aws ec2 endpoints `create_volume`
and `describe_volumes` do not include the `Tags` key in the
`response.Volumes[]` object.

However, moto does include the `Tags` key in this case. This discrepancy
in behaviour can result in code passing a moto test but failing in
production.

Sample snippets that trigger this condition:

```
def create_volume_and_then_get_tags_from_response():
    client = boto3.client('ec2', region_name='us-east-1')
    volume_response = client.create_volume(
        Size=10,
        AvailabilityZone='us-east-1a'
    )
    keys = volume_response['Keys']
```

```
def create_volume_and_then_get_tags_from_describe_volumes():
    client = boto3.client('ec2', region_name='us-east-1')
    volume_response = client.create_volume(
        Size=10,
        AvailabilityZone='us-east-1a'
    )
    volume_describe_response = client.describe_volumes()
    keys = volume_describe_response['Volumes'][0]['Keys']
```

Both sample snippets will succeed in a moto test, but fail with a
`KeyError` when using the aws api.
2019-03-07 17:25:18 -05:00
Jon Beilke
c1ebec1b35 remove start_time from attrib comparison in test_copy_snapshot() 2018-10-08 10:17:51 -05:00
Steve Pulec
96aba00242 Add freeze_time for ebs test. 2018-05-30 20:39:37 -04:00
Phil Christensen
ae2650ffc7 copy snapshot unit test 2018-04-15 17:08:54 -04:00
keirbadger
fecdf388c2 Add in filtering of EBS volumes on availability-zone (#1468) 2018-03-21 08:58:32 -07:00
grahamlyons
f3debf8f6f Test and fix bug for snapshot searching
The logic which contructed a list of values for parameters with
multiple values was flawed in that e.g. `Subnet.1` and `Subnet.10`
would be have their values counted against `Subnet.1` because they
share a prefix.

This now checks for a starting `.` before counting that name as
having the requested prefix.
2018-01-29 14:30:21 +00:00
Terry Cain
bd8c1e4567
adding owner id to amis v2 (#1331)
* Adding owner-id/OwnerId to the AMI classes to allow the value to be specified to test filtering images based on owner.

* Added default AMIs and filtering by owner-id

* Fixed some tests

* Fixed more random tests

* Updated MANIFEST

* .
2017-11-12 11:18:25 +00:00
Nuwan Goonasekera
08c4eff0b2 Added invalid id exceptions when filtering snapshots and volumes 2017-09-18 23:38:04 +05:30
Steve Pulec
0adebeed24 Merge #913. 2017-05-10 21:58:42 -04:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
rocky4570fft
d6f76cbb43 Add dry_run to a number of EC2 services 2016-10-16 00:34:52 +10:00
Andrew Gross
b4176050e2 Add volume attachment status 2016-07-22 14:23:42 -04:00
Kieran Doonan
e9af4c9065 changed equal to be for booleans 2016-07-04 14:21:31 +01:00
Kieran Doonan
2d73052eef added tests for encrypted snapshots 2016-07-04 14:19:29 +01:00
Kieran Doonan
bf73cb603d added tests for unencrypted filter 2016-07-04 14:09:15 +01:00
Kieran Doonan
8ccc210eef added tests for encrypted ec2 volumes 2016-07-04 11:01:48 +01:00
Denver Janke
ee33ff582c Add filter for volume-id on volumes. 2016-01-20 12:24:33 +10:00
Denver Janke
82b0b12e45 Add filters for describeVolumes and describeSnapshots. 2016-01-11 15:46:30 +10:00
Steve Pulec
cddf139bbc Add ability to create EBS volumes from snapshots. Closes #447. 2015-11-03 09:37:02 -05:00
Steve Pulec
d3e4c2c4b5 Add ability for specific backends to enable template escaping. Closes #441. 2015-11-03 09:25:47 -05:00
nuwan_ag
0b3ad166c0 Set snapshots to be in a completed state after being created and added
test case
2015-10-14 02:34:36 +11:00
Ilya Sukhanov
6a89786007 Remove hardcoded region in ebs test 2015-08-03 10:45:01 -04:00
Rob Walker
7b3f17e8f0 add modified tests for volume and snapshot changes. 2015-07-26 09:53:03 +10:00
Steve Pulec
2a61ef6f91 Cleanup some tests to work across regions. cc #232 2014-11-15 13:50:58 -05:00
Steve Pulec
2d65b0a020 Some EC2 fixes for alternative regions. 2014-10-30 22:46:24 -04:00
David Baumgold
4201e6b430 from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00
Shawn Falkner-Horine
ebc0037659 Implementation for ModifySnapshotAttribute and DescribeSnapshotAttribute. 2014-08-26 15:16:58 -07:00
Shawn Falkner-Horine
c97417d8e7 Error handling: Model-level validations, proper error responses. (backport assert_raises as context manager for Python 2.6) 2014-08-25 15:09:38 -07:00
Shawn Falkner-Horine
071c03e216 Error handling: Model-level validations, proper error responses. 2014-08-25 10:54:47 -07:00
Andres Riancho
9c1032da58 Fix #160, implemented blockDeviceMapping modify_attribute set 2014-08-20 08:20:08 -03:00
Andres Riancho
e94a7ed6ff First, we make it crash #160 2014-08-20 08:20:06 -03:00
Steve Pulec
59fe1abfdf Cleanup flake8 2013-08-03 17:21:25 -04:00
Steve Pulec
2d98a9caef some more tests to bump coverage 2013-03-11 00:12:22 -04:00
Steve Pulec
a728b2581a Adding server mode 2013-03-05 08:14:43 -05:00
Steve Pulec
e261b82f29 add most of the snapshot implementation 2013-02-23 18:01:41 -05:00
Steve Pulec
f92a3ec00f volume attaching and detaching working 2013-02-23 17:37:55 -05:00
Steve Pulec
27a086409e adding ec2 stubs 2013-02-21 23:13:01 -05:00