Testing Pipe and Injector #274
Unanswered
josejachuf
asked this question in
Q&A
Replies: 2 comments
-
@josejachuf probably you just need to call def test_signed_route(app):
@app.route('/test_route/<str:a>/<str:b>', pipeline=[SignPipe()])
def test_route(a, b):
return "Test Router"
_url = url('test_route', args=['a', 'b'], params=dict(id=10), sign=SignInjector.sign)
builder = EnvironBuilder(_url)
current.initialize(builder.get_environ())
response = current.response
app.route.dispatch()
assert response.status != 404
assert response.output == 'Test Router' |
Beta Was this translation helpful? Give feedback.
0 replies
-
It does not work. Keep giving the same error. I get a different error:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @gi0baro I ask around here because apparently weppy-talk is dead.
This is in weppy 1.3.4 and python 3.6
Continuing with the tests, I am trying to test a Pipe and an Injector. I am sure that both work well, because I have been using them for years and they have not touched since that time. In this case it is simply to understand how the test would be.
I think I could do it directly against the real app, but want to abstract me from it.
I am trying to create some tests seeing in [1] and [2]
I have the following (what is a copy of your test):
The above obviously passes the test, but what I want to have is something like this:
So how should I approach this test?
[1] https://github.com/emmett-framework/emmett/blob/1.x/tests/test_pipeline.py
[2] https://github.com/emmett-framework/emmett/blob/1.x/tests/test_expose.pytest
Beta Was this translation helpful? Give feedback.
All reactions