Commit Graph

77 Commits

Author SHA1 Message Date
Bert Blommers
b065a20d88
Rework mock_all to work as a context manager (#4607) 2021-11-22 22:06:59 -01:00
Bert Blommers
e54e5cdb95
Feature - @mock_all() (#3756) 2021-11-09 21:29:28 -01:00
Bert Blommers
c62a34528e
Work-around for import order (#4103) 2021-11-09 20:39:31 -01:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Bert Blommers
4c18b36170
SQS - duplicate deprecated tests (#4326) 2021-09-22 21:50:27 +00:00
Bert Blommers
9d1dd79813
Rewrite deprecated DynamoDB2 tests (#3904) 2021-09-22 18:13:28 +00:00
Bert Blommers
07bb843214
Fix regex URLs so that a dot is actually interpreted as a dot (#4110) 2021-08-28 13:42:45 +01:00
Bert Blommers
8f79edba38
Request matching - return known requests first (#3793) 2021-08-28 13:34:32 +01:00
Bert Blommers
79f0cc9e9e
Tech debt - remove dead DynamoDB code and add RDS tests (#4136) 2021-08-04 17:24:26 +01:00
Waldemar Hummer
faadf3db3a
fix parsing regex to support request params with dicts of lists (#4111) 2021-07-30 06:19:38 +01:00
Bert Blommers
11883a1fda
Remove unnecessary dependencies EC2/SQS (#4094)
* Add missing dependencies for EFS
2021-07-29 06:38:16 +01:00
Bert Blommers
7693d77333
Remove Py2 support (#3915) 2021-07-26 07:40:39 +01:00
Evan O'Connell
85dc52bd84
Support all ELBv2 ListenerRule condition types (#4066)
* ELBv2 - ListenerRule condition validation

- ListenerRule condition model now uses upper case field names that
  match input params for boto and CloudFormation.
- BaseResponse._get_params() introduced to make it easier to deal
  with the querystring input params.
2021-07-16 08:01:14 +01:00
David Baumgold
3af87963d1
Py3: use unittest.mock instead of mock (#3481)
* Py3: use unittest.mock instead of mock

* noqa

* oops

* just pull in patch()

* ignore RuntimeError when stopping patch

* ignore RuntimeError from default_session_mock.stop()
2021-04-06 10:22:42 +01:00
Anton Grübel
6da4905da9
Fix AttributeNames for sqs.receive_message (#3736)
* Fix AttributeNames for sqs.receive_message

* Fix Lambda issue

* Change to parametrized tests

* Simplify attribute logic
2021-03-05 10:42:07 +00:00
Bert Blommers
d7b8419791
Fix Mock 4.0.3 compatibility - Unpatch only once during teardown (#3541)
* #3535 - Unpatch only once during teardown

* EnvVar patching - Fix Python2 bug

* Allow latest version of mock-library
2021-02-15 08:42:16 +00:00
Brian Pandola
f4b81e69b8
Address pytest warnings (#3629)
* Address `boto` deprecation warnings

This commit eliminates the following warning:

../boto/ec2/connection.py:582:
  PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.

`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.

* Remove `invoke_lambda` tracebacks from unit test logging

If an exception is encountered, the details are returned in the response payload.
Printing the traceback was just adding noise to the pytest output.

* Use known AMIs in unit tests

This commit eliminates the following warning in the pytest output:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

Known, pre-loaded AMI image ids are used instead of random ids that don't actually
exist in the moto backend.  The integrity of the tests is unaffected by this change.

A test has been added to provide explicit coverage of the PendingDeprecationWarning
raised when an invalid AMI image id is passed to moto.
2021-01-29 11:31:56 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +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
Karthikeyan Singaravelan
7054143701
Fix deprecation warnings due to invalid escape sequences. (#3273)
* Fix deprecation warnings due to invalid escape sequences.

* Fix linter error.
2020-09-10 09:20:26 +01:00
Bert Blommers
7b5613b331 #2774 - Re-add test, and update requirements to working botocore 2020-03-09 12:47:44 +00:00
Bert Blommers
c6b66cb001 Linting 2020-03-05 17:22:54 +00:00
Bert Blommers
b19cf8a085 #2774 - Run Policy test on different method 2020-03-05 15:49:30 +00:00
Mike Grima
11b7be0e85 Implemented S3 Account-level public access block.
- Also added AWS Config listing and fetching support
- Also fixed Lambda test breakage
2020-02-17 15:41:27 -08:00
Fabio Dias
fd9ac4b9a5 ACCOUNT_ID moved to moto.core, MOTO_ACCOUNT_ID env var override 2019-12-16 21:05:29 -05:00
Mike Grima
84ccdbd1cd Implemented S3 Public Access Block 2019-12-12 17:45:31 -08:00
Bert Blommers
e025ccfd06 Ensure IAM Policy names are unique in tests 2019-11-16 17:36:50 +00:00
Ian Yon
f235fa145e Added Exception for create_policy when policy exists 2019-11-05 15:57:38 -03:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Steve Pulec
aa896a0c2e
Merge pull request #2294 from spulec/fix-responses-mocking
Cleanup responses mocking. Closes #1567
2019-09-11 22:06:36 -05:00
acsbendi
cf2dae0ce8 Calling sts:GetCallerIdentity is always allowed. 2019-08-22 18:09:52 +02:00
Steve Pulec
69d86cbd54
Merge pull request #2300 from acsbendi/master
Basic IAM authentication, authorization
2019-07-28 17:22:52 -05:00
acsbendi
62b25f9914 Added a few more tests to achieve better coverage. 2019-07-28 22:19:50 +02:00
acsbendi
cc843bb8c5 Created tests for IAM auth. 2019-07-26 20:40:15 +02:00
Steve Pulec
4dd2b66b04 Refactor backend parsing. 2019-07-21 22:07:58 -05:00
Steve Pulec
2a0df1e1a8 Flip when we test passthru. 2019-07-11 10:09:01 -05:00
Steve Pulec
11506e21d5 Only test passthrough exception in non-server mode. 2019-07-10 22:45:26 -05:00
Steve Pulec
c7147b06b1 Cleanup responses mocking. Closes #1567
This unblocks requests to other websites with requests while Moto
is activated. It also adds a wildcard for AWS services to still
ensure no accidental requests are made for unmocked services
2019-07-10 21:59:25 -05:00
Steve Pulec
c2e382f537 Dont test context manager in server mode. 2019-07-10 21:40:49 -05:00
Steve Pulec
b19c201975 Cleanup model ref resetting. 2019-07-10 21:16:11 -05:00
Steve Pulec
308712841c Have context manager return mock. 2019-07-09 20:31:43 -05:00
Cory Dolphin
f11a5dcf6b Fix socket.fakesock compatibility 2019-07-03 11:26:33 -07:00
Garrett
c739c5331e Handle UnicodeEncodeError when parsing querystring (#2170) 2019-05-25 18:34:47 +01:00
Ollie Ford
28aa5d34b0
Add failing test for #1809 2018-09-05 11:31:47 +01:00
Steve Pulec
25e2af0320 Fix camelcase_to_underscore. Closes #767. 2017-03-15 23:39:36 -04:00
Steve Pulec
cda553abfb Change tests to use default server port of 5000. 2017-03-12 21:04:19 -04:00
Steve Pulec
1709208872 First version of dashboard. 2017-03-11 22:45:42 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00