getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.6k stars 2.03k forks source link

[BUG] route53 tagging for hostedzones & list_tags_for_resources does not work properly #8130

Closed zkarpinski closed 1 week ago

zkarpinski commented 1 week ago

There are two bugs for route53.

To recreate, add assert len(response["ResourceTagSets"]) == 2 in test_route53.py -> test_list_tags_for_resources() above for set in response["ResourceTagSets"]: on line 588.

list_tags_for_resources() doesn't actually return anything and it's stems from 3 bugs.

  1. The list_or_change_tags_for_resource_request api doesn't decode the url encoding in the ID. Thus, characters like "/" are encoded when tags are added. This impacts hostedzones which have slashes in the ID. list_tags_for_resources the id are not encoded, so the key is never found and returns no results.
  2. The list of ids isn't capture correctly, it's passing a dictionary instead of the list of ids.
  3. The template for list_tags_for_resources doesn't work as expected and needs refactoring.

The test-case mentioned doesn't test what you expect and thus passes incorrectly.