Skip to content

Instantly share code, notes, and snippets.

@BrutalSimplicity
Created August 19, 2022 21:03
Show Gist options
  • Save BrutalSimplicity/d6e74664e9475bfef3af3acb6d7d284c to your computer and use it in GitHub Desktop.
Save BrutalSimplicity/d6e74664e9475bfef3af3acb6d7d284c to your computer and use it in GitHub Desktop.
hook/test example
import boto3
def hook(config_file, **kwargs):
events = boto3.client('events')
delete_endpoint(events, config_file, kwargs)
def delete_endpoint(, config_file, **kwargs):
# move work here
...
def test_hook_endpoint_not_exists():
# same stubber setup
# pass the reference to the eb client you create in the test session into the
# function doing the work
delete_endpoint.delete_endpoint(stubbed_eb_client, config_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment