cloudtools / stacker

An AWS CloudFormation Stack orchestrator/manager.
http://stacker.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
711 stars 167 forks source link

Add Keypair Unit Test #700

Closed alecrajeev closed 5 years ago

alecrajeev commented 5 years ago

Uses moto to mock creating and describing the keypair API for unit testing. This increases coverage for hooks/keypair

danielkza commented 5 years ago

This test has hardcoded paths to CircleCI that break running the tests locally: #709

Having written the hook and now looking at this, I strongly recommend to:

a) Not test the logging messages. That makes the test very fragile and adds little value against regressions. b) Create a temporary directory and use it as the "home base" for any test that requires simulating/inspect file manipulation. It's the most comprehensive way to observe behavior close to reality, and does not break in different environments.