Skip to content

Commit

Permalink
rename deprecated toolbar_middleware_factory to middleware in tests a…
Browse files Browse the repository at this point in the history
…nd exmple
  • Loading branch information
jettify committed Jun 1, 2015
1 parent d272ca4 commit 579286c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def exception_handler(request):
@asyncio.coroutine
def init(loop):
# add aiohttp_debugtoolbar middleware to you application
app = web.Application(loop=loop, middlewares=[aiohttp_debugtoolbar
.toolbar_middleware_factory])
app = web.Application(loop=loop,
middlewares=[aiohttp_debugtoolbar.middleware])
# install aiohttp_debugtoolbar
aiohttp_debugtoolbar.setup(app)

Expand Down
5 changes: 2 additions & 3 deletions tests/test_exception_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import jinja2
from aiohttp import web

from aiohttp_debugtoolbar import (toolbar_middleware_factory,
setup as tbsetup, APP_KEY)
from aiohttp_debugtoolbar import (middleware, setup as tbsetup, APP_KEY)

from .base import BaseTest

Expand All @@ -14,7 +13,7 @@ class TestExceptionViews(BaseTest):
@asyncio.coroutine
def _setup_app(self, handler, **kw):
app = web.Application(loop=self.loop,
middlewares=[toolbar_middleware_factory])
middlewares=[middleware])

tbsetup(app, **kw)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_middlware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import jinja2
from aiohttp import web

from aiohttp_debugtoolbar import toolbar_middleware_factory, setup as tbsetup
from aiohttp_debugtoolbar import middleware, setup as tbsetup

from .base import BaseTest

Expand All @@ -14,7 +14,7 @@ class TestMiddleware(BaseTest):
@asyncio.coroutine
def _setup_app(self, handler, **kw):
app = web.Application(loop=self.loop,
middlewares=[toolbar_middleware_factory])
middlewares=[middleware])

tbsetup(app, **kw)

Expand Down Expand Up @@ -207,6 +207,6 @@ def test_setup_not_called_exception(self):
def go():
app = web.Application(loop=self.loop)
with self.assertRaises(RuntimeError):
yield from toolbar_middleware_factory(app, lambda r: r)
yield from middleware(app, lambda r: r)

self.loop.run_until_complete(go())
6 changes: 2 additions & 4 deletions tests/test_server_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
import jinja2
from aiohttp import web

from aiohttp_debugtoolbar import (toolbar_middleware_factory,
setup as tbsetup, APP_KEY)
from aiohttp_debugtoolbar import middleware, setup as tbsetup, APP_KEY

from .base import BaseTest


class TestExceptionViews(BaseTest):
@asyncio.coroutine
def _setup_app(self, handler, **kw):
app = web.Application(loop=self.loop,
middlewares=[toolbar_middleware_factory])
app = web.Application(loop=self.loop, middlewares=[middleware])

tbsetup(app, **kw)

Expand Down

0 comments on commit 579286c

Please sign in to comment.