* 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()
* Fix `DBInstanceNotFound` error message
Changed from `Database` to `DBInstance`, which is actually what comes back from AWS.
* Remove duplicate test
The removed test actually fails if run in isolation because `rds2` is not a
valid boto3 client service. The reason this test never caused CI to fail is
because it is redefined later in the test suite, effectively making it dead
code that will never run.
Duplicate test has been removed and the remaining test has been improved
with more explicit asserts.
* Add support for RDS resource filtering
* Extensive testing was performed against real AWS endpoints in order to
nail down the filter behavior under various scenarios, ensuring that
`moto` returns the proper response or error.
* Full test coverage of all utility functions as well as several
filter/parameter combinations.
* Split up filter tests, per PR feedback
* Remove unused import
* Fix pytest teardown failure on Python 2.7
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request. These tests do not cover or verify
any `moto` behavior and have been removed.
In all of the tests of `create_db_instance()`, the `AllocatedStorage`
parameter is provided. The [RDS API
reference](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html)
says this parameter is optional; however, when none is provided, moto
returns an obscure error message:
```
self = <botocore.parsers.QueryParser object at 0x113745890>, shape = <Shape(Integer)>, text = 'None'
@_text_content
def _handle_integer(self, shape, text):
> return int(text)
E ValueError: invalid literal for int() with base 10: 'None'
/usr/local/Cellar/pyenv/1.2.13_1/versions/3.7.4/envs/rds_encrypt/lib/python3.7/site-packages/botocore/parsers.py:466: ValueError
```
This PR adds default values that correspond to the current default API
behaviors.
* Correctly return all snapshots for a given DBInstanceIdentifier.
* If an invalid DBInstanceIdentifier is passed in, return an empty array
instead of raising a ClientError (which is what AWS actually does).
Fixes#1569
We need to mock out deploying RDS instances with full disk encryption
and detailed tagging. We also need to be able do deploy these instances
with Cloudformation, and then access them with both boto and boto3.
* Join RDS and RDS2 backends - this makes RDS resources created via
either of the two boto RDS APIs visible to both, more closely
mirroring how AWS works
* Fix RDS responses that were returning JSON but should be returning XML
* Add mocking of RDS Cloudformation calls
* Add mocking of RDS full disk encryption with KMS
* Add mocking of RDS DBParameterGroups
* Fix mocking of RDS DBSecurityGroupIngress rules
* Make mocking of RDS OptionGroupOptions more accurate
* Fix mocking of RDS cross-region DB replication
* Add RDS tag support to:
* DBs
* DBSubnetGroups
* DBSecurityGroups
Signed-off-by: Andrew Garrett <andrew.garrett@getbraintree.com>