9,10c9,10 < def setUp(self): < super().setUp() --- > def setup_method(self): > super().setup_method() 38,43c38,43 < self.assertEqual(resp['status'], 200) < self.assertIn('Server', resp['headers']) < self.assertIn('Date', resp['headers']) < self.assertEqual(resp['headers']['Content-Length'], '0') < self.assertEqual(resp['headers']['Connection'], 'close') < self.assertEqual(resp['body'], '', 'body') --- > assert resp['status'] == 200 > assert 'Server' in resp['headers'] > assert 'Date' in resp['headers'] > assert resp['headers']['Content-Length'] == '0' > assert resp['headers']['Connection'] == 'close' > assert resp['body'] == '', 'body' 46,47c46,47 < self.assertEqual(resp['status'], 200) < self.assertEqual(resp['body'], '', 'body') --- > assert resp['status'] == 200 > assert resp['body'] == '', 'body' 50,52c50,52 < self.assertEqual(len(re.findall('200 OK', resp)), 10) < self.assertEqual(len(re.findall('Connection:', resp)), 1) < self.assertEqual(len(re.findall('Connection: close', resp)), 1) --- > assert len(re.findall('200 OK', resp)) == 10 > assert len(re.findall('Connection:', resp)) == 1 > assert len(re.findall('Connection: close', resp)) == 1 55,60c55,60 < self.assertEqual(resp['status'], 200) < self.assertIn('Server', resp['headers']) < self.assertIn('Date', resp['headers']) < self.assertEqual(resp['headers']['Content-Length'], '0') < self.assertNotIn('Connection', resp['headers']) < self.assertEqual(resp['body'], '', 'body') --- > assert resp['status'] == 200 > assert 'Server' in resp['headers'] > assert 'Date' in resp['headers'] > assert resp['headers']['Content-Length'] == '0' > assert 'Connection' not in resp['headers'] > assert resp['body'] == '', 'body' 63c63 < self.assertIn('success', self.conf('0', 'routes/0/action/return')) --- > assert 'success' in self.conf('0', 'routes/0/action/return') 66,67c66,67 < self.assertEqual(resp['status'], 0) < self.assertEqual(resp['body'], '') --- > assert resp['status'] == 0 > assert resp['body'] == '' 69c69 < self.assertIn('success', self.conf('404', 'routes/0/action/return')) --- > assert 'success' in self.conf('404', 'routes/0/action/return') 72,73c72,73 < self.assertEqual(resp['status'], 404) < self.assertNotEqual(resp['body'], '') --- > assert resp['status'] == 404 > assert resp['body'] != '' 75c75 < self.assertIn('success', self.conf('598', 'routes/0/action/return')) --- > assert 'success' in self.conf('598', 'routes/0/action/return') 78,79c78,79 < self.assertEqual(resp['status'], 598) < self.assertNotEqual(resp['body'], '') --- > assert resp['status'] == 598 > assert resp['body'] != '' 81c81 < self.assertIn('success', self.conf('999', 'routes/0/action/return')) --- > assert 'success' in self.conf('999', 'routes/0/action/return') 84,85c84,85 < self.assertEqual(resp['status'], 999) < self.assertEqual(resp['body'], '') --- > assert resp['status'] == 999 > assert resp['body'] == '' 89,90c89,92 < unreserved = ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" < "0123456789-._~") --- > unreserved = ( > "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" > "0123456789-._~" > ) 98,104c100,102 < self.assertIn( < 'success', < self.conf( < {"return": 301, "location": location}, 'routes/0/action' < ), < 'configure location' < ) --- > assert 'success' in self.conf( > {"return": 301, "location": location}, 'routes/0/action' > ), 'configure location' 106c104 < self.assertEqual(self.get()['headers']['Location'], expect) --- > assert self.get()['headers']['Location'] == expect 148,155c146,149 < self.assertIn( < 'success', < self.conf( < {"return": 302, "location": "blah"}, 'routes/0/action' < ), < 'configure init location' < ) < self.assertEqual(self.get()['headers']['Location'], 'blah') --- > assert 'success' in self.conf( > {"return": 302, "location": "blah"}, 'routes/0/action' > ), 'configure init location' > assert self.get()['headers']['Location'] == 'blah' 157,162c151,154 < self.assertIn( < 'success', < self.conf_delete('routes/0/action/location'), < 'location delete' < ) < self.assertNotIn('Location', self.get()['headers']) --- > assert 'success' in self.conf_delete( > 'routes/0/action/location' > ), 'location delete' > assert 'Location' not in self.get()['headers'] 164,169c156,159 < self.assertIn( < 'success', < self.conf('"blah"', 'routes/0/action/location'), < 'location restore' < ) < self.assertEqual(self.get()['headers']['Location'], 'blah') --- > assert 'success' in self.conf( > '"blah"', 'routes/0/action/location' > ), 'location restore' > assert self.get()['headers']['Location'] == 'blah' 171,176c161,164 < self.assertIn( < 'error', < self.conf_post('"blah"', 'routes/0/action/location'), < 'location method not allowed' < ) < self.assertEqual(self.get()['headers']['Location'], 'blah') --- > assert 'error' in self.conf_post( > '"blah"', 'routes/0/action/location' > ), 'location method not allowed' > assert self.get()['headers']['Location'] == 'blah' 180c168 < self.assertIn('error', self.conf(conf, 'routes/0/action')) --- > assert 'error' in self.conf(conf, 'routes/0/action') 189,191c177,179 < self.assertIn( < 'error', self.conf('001', 'routes/0/action/return'), 'leading zero' < ) --- > assert 'error' in self.conf( > '001', 'routes/0/action/return' > ), 'leading zero' 195,198d182 < < < if __name__ == '__main__': < TestReturn.main()