MCPcopy Index your code
hub / github.com/bottlepy/bottle / test_apply

Method test_apply

test/test_plugins.py:184–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182
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
196 def test_instance_method_wrapper(self):
197 class Plugin(object):

Callers

nothing calls this directly

Calls 3

PluginClass · 0.85
installMethod · 0.80
assertBodyMethod · 0.80

Tested by

no test coverage detected