Skip to content

Commit

Permalink
Move asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Mar 28, 2024
1 parent 778556d commit a91cfd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pywb/warcserver/test/test_inputreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ def __call__(self, environ, start_response):
class TestInputReq(object):
def setup(self):
self.app = InputReqApp()
assert self.app
self.testapp = webtest.TestApp(self.app)
assert self.testapp

def test_get_direct(self):
assert self.testapp
res = self.testapp.get('/test/http://example.com/', headers={'Foo': 'Bar'})
assert res.text == '\
GET /test/http://example.com/ HTTP/1.0\r\n\
Expand All @@ -55,6 +54,7 @@ def test_get_direct(self):
'

def test_post_direct(self):
assert self.testapp
res = self.testapp.post('/test/http://example.com/', headers={'Foo': 'Bar'}, params='ABC')
lines = res.text.split('\r\n')
assert lines[0] == 'POST /test/http://example.com/ HTTP/1.0'
Expand All @@ -71,6 +71,7 @@ def test_post_req(self):
Foo: Bar\r\n\
\r\n\
'
assert self.testapp
res = self.testapp.post('/test-postreq?url=http://example.com/', params=postdata)

assert res.text == '\
Expand Down

0 comments on commit a91cfd9

Please sign in to comment.