1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-24 06:59:52 +01:00

Move asserts

This commit is contained in:
Tessa Walsh 2024-03-28 14:47:51 -04:00
parent 778556d7a0
commit a91cfd9506

View File

@ -41,11 +41,10 @@ class InputReqApp(object):
class TestInputReq(object): class TestInputReq(object):
def setup(self): def setup(self):
self.app = InputReqApp() self.app = InputReqApp()
assert self.app
self.testapp = webtest.TestApp(self.app) self.testapp = webtest.TestApp(self.app)
assert self.testapp
def test_get_direct(self): def test_get_direct(self):
assert self.testapp
res = self.testapp.get('/test/http://example.com/', headers={'Foo': 'Bar'}) res = self.testapp.get('/test/http://example.com/', headers={'Foo': 'Bar'})
assert res.text == '\ assert res.text == '\
GET /test/http://example.com/ HTTP/1.0\r\n\ GET /test/http://example.com/ HTTP/1.0\r\n\
@ -55,6 +54,7 @@ Foo: Bar\r\n\
' '
def test_post_direct(self): def test_post_direct(self):
assert self.testapp
res = self.testapp.post('/test/http://example.com/', headers={'Foo': 'Bar'}, params='ABC') res = self.testapp.post('/test/http://example.com/', headers={'Foo': 'Bar'}, params='ABC')
lines = res.text.split('\r\n') lines = res.text.split('\r\n')
assert lines[0] == 'POST /test/http://example.com/ HTTP/1.0' assert lines[0] == 'POST /test/http://example.com/ HTTP/1.0'
@ -71,6 +71,7 @@ GET /example.html HTTP/1.0\r\n\
Foo: Bar\r\n\ Foo: Bar\r\n\
\r\n\ \r\n\
' '
assert self.testapp
res = self.testapp.post('/test-postreq?url=http://example.com/', params=postdata) res = self.testapp.post('/test-postreq?url=http://example.com/', params=postdata)
assert res.text == '\ assert res.text == '\