mintel / pytest-localstack

Pytest plugin for local AWS integration tests
MIT License
78 stars 17 forks source link

Mocking Account numbers #26

Open rpattcorner opened 5 years ago

rpattcorner commented 5 years ago

25 Now that IAM seems fully supported it's looking like pytest-localstack is the best and only game in town for testing mocks in multi-account environments. And multi-account is becoming more widely used, as the GCP-originated paradigm of treating an account as a project for security isolation is growing.

From what I can tell, pytest-localstack's mapping of "docker container to session fixture to account" is a great way to go, and it would be even better if we could mock account numbers on a per-fixture basis. Currently all sessions have a mocked account number of '000000000000', but it might be simple enough to add mock_account_number as a parameter to the fixture so we could devise cross-account tests that took ARNs into account.

Automatic generation of account numbers might be possible or desirable too, but a fixture parameter that overrides the zeros might easily be enough.

Just a thought to make a good thing better ...