Skip to content

Instantly share code, notes, and snippets.

@mdipierro
Last active October 24, 2020 17:33
Show Gist options
  • Save mdipierro/ddc233d653a3ffa64fd7a8072558e0fc to your computer and use it in GitHub Desktop.
Save mdipierro/ddc233d653a3ffa64fd7a8072558e0fc to your computer and use it in GitHub Desktop.
class Injector(Fixture):
def __init__(self, **objects):
self.objects = objects
def transform(self, output, shared_data=None):
if isinstance(output, dict):
output.update(**self.objects)
return output
injector = Injector(menu)
@action('index')
@action.uses(injector)
def index():
return dict()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment