MCPcopy Create free account
hub / github.com/bottlepy/bottle / Plugin

Class Plugin

test/test_plugins.py:185–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184 def test_apply(self):
185 class Plugin(object):
186 def apply(self, func, route):
187 def wrapper(*a, **ka):
188 return func(test=route.config['test'], *a, **ka) + '; tail'
189 return wrapper
190 def __call__(self, func):
191 raise AssertionError("Plugins must not be called "\
192 "if they implement 'apply'")
193 self.app.install(Plugin())
194 self.assertBody('test:plugin.cfg; tail', '/')
195

Callers 4

test_applyMethod · 0.85
test_setupMethod · 0.85
test_closeMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_applyMethod · 0.68
test_setupMethod · 0.68
test_closeMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…