Commit Graph

77 Commits

Author SHA1 Message Date
Bert Blommers
a7f3b367b4 Introduce mock_aws() (#7194) 2024-01-27 19:38:09 +00:00
tungol
55c589072f
Admin: sorting imports with ruff (#7075) 2023-11-30 14:55:51 -01:00
Miki Watanabe
5b2da11e19
BUG: fix lint error E721 (#6767)
Co-authored-by: 渡邊 美希 <miki.watanabe@watanabes-MacBook-Pro.local>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2023-09-06 13:08:35 +00:00
Bert Blommers
264723d981
Techdebt: Do not load EC2 images unless necessary, to speed things up (#6761) 2023-09-03 14:59:09 +00:00
Bert Blommers
9da27b76ef
Techdebt: Replace sure with regular assertions in ECS (#6533) 2023-07-18 15:33:16 +00:00
Bert Blommers
79bd7c5bae
Techdebt: Replace sure with regular assertions in EC2 (#6525) 2023-07-17 09:31:05 +00:00
Hisashi Kamezawa
681873d177
EC2: create_volume(): support Throughput-parameter (#6379) 2023-06-08 11:35:57 +00:00
Bert Blommers
27a2e42d9b
Admin: Update Docs to point to getmoto (#5826) 2023-01-07 10:35:14 -01:00
Hisashi Kamezawa
52891e1641
EC2: Add iops to volume (#5776) 2022-12-16 19:22:55 -01:00
Bert Blommers
1a8ddc0f2b
Techdebt: Replace string-format with f-strings (for tests dirs) (#5678) 2022-11-17 21:41:08 -01:00
Viren Nadkarni
37fa5f8bf4
EC2: implement ModifyVolumes and DescribeVolumesModifications (#5399) 2022-08-24 09:23:21 +00:00
Bert Blommers
3d913f8f15
MultiAccount support (#5192) 2022-08-13 09:49:43 +00:00
Bert Blommers
10bd677cf2
Admin - enable more Pylint rules (#5037) 2022-04-18 20:44:56 +00:00
Bert Blommers
d53dd23390
EC2 - create_snapshots (#4767) 2022-01-25 09:27:02 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency (#4378) 2022-01-18 14:18:57 -01:00
Dominik Schubert
756f772c5c
EC2 - fix missing AZ on auto-generated volumes for instances (#4560) 2021-11-11 11:50:07 -01:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Bert Blommers
4e45152d86
EC2:create_volume() - Add support for VolumeType (#4264) 2021-10-10 19:16:28 +00:00
Bert Blommers
8526013e61
Parallelize tests - Part 1 (#4368) 2021-10-05 17:11:07 +00:00
Bert Blommers
939b800e96
Rewrite deprecated EC2 tests (#3881) 2021-09-25 11:13:07 +00:00
Bert Blommers
4e7153c655
EC2 - DryRun-requests should return 412 status code (#4270) 2021-09-07 17:10:01 +01:00
Bert Blommers
737636f9df
Tech debt (#3653) 2021-02-02 16:31:26 +00:00
Bert Blommers
77dd35e3b8
Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
6d364dc7aa Pytest model of exceptions uses 'value' attribute instead of 'exception'. 2020-11-11 12:21:04 +01:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
Brian Pandola
ccda76898a
Add KMS Support to EBS Encrypted Volumes (#3383)
* Properly coerce `Encrypted` attribute to bool on request/response.
* Create and use a default AWS managed CMK for EBS when clients request
  an encrypted volume without specifying a KmsKeyId.

NOTE: A client-provided KmsKeyId is simply stored as-is, and is not validated
against the KMS backend. This is in keeping with other moto backends (RDS, Redshift)
that currently also accept unvalidated customer master key (CMK) parameters, but could
be an area for future improvement.

Closes #3248
2020-10-14 15:18:50 +01:00
Brian Pandola
d00cefa25c
Add tagging to ec2.CopySnapshot (#3365)
The `@freeze_time` decorator was removed because it is not necessary (and was
causing the test to be skipped).

Closes #2940
2020-10-09 12:33:07 +01:00
Larry Aiello
06ed67a8e5
Implement UserIds for Snapshot Attributes (#3192)
* implement register_image

* format code

* add user_ids to snapshot model

* implement register_image

* format code

* add user_ids to snapshot model

* trying to un-deprecate tests

* Write tests and finalize implementation

* Add region parameter to boto3 resource call

* fixed test error
2020-08-01 17:03:54 +01:00
mickeypash
a6864f483d Use Python 2 format 2020-04-03 14:17:55 +01:00
mickeypash
d3367b8a90 Black formatting 2020-04-03 02:27:46 +01:00
mickeypash
76b9cbe16d Fix test 2020-04-03 02:14:14 +01:00
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