예제 #1
0
 def _(_):
     res = testApp.get('/page_with_params_dictionary_as_input?a=A&b=B')
     expect(res.status) == 200
     expect(res.body) != b'{}'
예제 #2
0
 def _(_):
     res = testApp.get('/page_with_parameters?a=A&a=AA')
     expect(res.status) == 200
     expect(res.body) == b"['A', 'AA']"
예제 #3
0
 def _(_):
     res = testApp.get('/page_without_params?a=A')
     expect(res.status) == 200
     expect(res.body) == b''
예제 #4
0
 def _(self):
     res = testApp.get('/missing/page?param=1&param=2')
     expect(res.status) == 200
     expect(res.body) == b'Missing Page: /missing/page'
예제 #5
0
 def _(_):
     expect(parseQuery("?a"))  == web.Storage(a=True)
예제 #6
0
 def _(self):
     res = testApp.get('/missingpage')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.default'
예제 #7
0
 def _(self):
     res = testApp.get('/')
     expect(res.status) == 200
     expect(res.body) == b'Missing Page: /'
예제 #8
0
 def _(_):
     def caller():
         res = testApp.post('/assert_post_request')
     
     expect(caller).not_raise()
예제 #9
0
 def _(self):
     res = testApp.get('/noIndexWithDefault')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelNoIndexWithDefault.default'
예제 #10
0
 def _(_):
     expect(True) == False 
예제 #11
0
 def _(self):
     res = testApp.get('/withDefault/missingpage/third')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelWithDefault.default'
예제 #12
0
 def _(self):
     res = testApp.get('/withDefault/notexposed')
     expect(res.status) == 200
     expect(res.body) == b'SecondLevelWithDefault.default'
예제 #13
0
 def _(self):
     res = testApp.get('/withoutDefault')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.default'
예제 #14
0
 def _(_):
     res = testApp.get('/page_with_parameters')
     expect(res.status) == 200
     expect(res.body) == b'A'
예제 #15
0
 def _(_):
     res = testApp.get('/html')
     expect(res.header('Content-Type')).should.startswith('text/html')
     expect(res.status) == 200
     expect(res.body) == b'HTML'
예제 #16
0
 def _(_):
     res = testApp.get('/assert_get_request')
     expect(res.status) == 200
     expect(res.body) == b''
예제 #17
0
 def _(_):
     res = testApp.get('/json')
     expect(res.header('Content-Type')).should.startswith('application/json')
     expect(res.status) == 200
     content = json.loads(res.body)
     expect(content) == 'JSON'
예제 #18
0
 def _(_):
     expect(parseQuery("?"))  == web.Storage()
예제 #19
0
 def _(_):
     res = testApp.get('/zipped_text_as_downloadable_file')
     expect(res.header('Content-Type')).should.startswith('application/text')
     expect(res.header('content-disposition')) == 'attachment;filename=myfile.csv'
     expect(res.status) == 200
     expect(unzipIt(res.body)) == b'zipped text file content'
예제 #20
0
 def _(_):
     expect(parseQuery("?a=A"))  == web.Storage(a='A')
예제 #21
0
 def _(self):
     res = testApp.get('/page')
     expect(res.status) == 200
     expect(res.body) == b'SiteRoot.page'