Closed aucheun-tu closed 3 days ago
Hi @aucheun-tu, thank you for raising this, and welcome to Moto!
That code was originally committed 10 years ago by someone else (see https://github.com/getmoto/moto/commit/6fad81aabfbdf65f3d463e9ca568ae95f94698d8) - I only refactored it last.
Regardless - it is indeed a bug. I've opened a PR that improves support for this. The test_example
function that you provide should work with this change.
@aucheun-tu moto >= 5.0.16.dev5
should fix the problem - are you able to upgrade and verify this?
@bblommers I updated to moto >= 5.0.16.dev5
and the issue was resolved. thanks for the quick response!
Great, happy to hear that @aucheun-tu.
I'll close this issue, but let us know if you run into any other issues!
When I attempt to use moto to mock the
modify_option_group
call for the RDS client. It seems theOptionsToInclude
value does not properly get passed into the call and moto ends up setting the value ofoptions_to_include
to an empty list,[]
. That leads to the following error:An error occurred (InvalidParameterValue) when calling the ModifyOptionGroup operation: At least one option must be added, modified, or removed.
.Here is an example of a pytest I setup to demonstrate this:
I also modified the
modify_option_group
function in themoto/rds/models.py
file with a print statement before running the example test:Running the test above along with the additional print statement added to moto results in the following error and print:
This seems to indicate despite the fact that I pass in
[{"OptionName": "TDE"}]
toOptionsToInclude
, moto is not receiving the value properly and setting it to[]
.Looking at the
test_modify_option_group
test in thetests/test_rds/test_rds.py
file, there is a comment that seems to indicate the developer of the tests ran into this same issue. Ref: https://github.com/getmoto/moto/blob/master/tests/test_rds/test_rds.py#L1480 Tagging @bblommers in case you know anything as it looks like this is your comment. Comment from the test:Please advise on if I am mocking
modify_option_group
properly of if this is a bug in moto. Thanks!