test_return.py (1441:b2caecb224f7) test_return.py (1443:433622b9cc55)
1import re
2import unittest
3from unit.applications.proto import TestApplicationProto
4
5
6class TestReturn(TestApplicationProto):
7 prerequisites = {}
8

--- 169 unchanged lines hidden (view full) ---

178 def test_return_invalid(self):
179 def check_error(conf):
180 self.assertIn('error', self.conf(conf, 'routes/0/action'))
181
182 check_error({"return": "200"})
183 check_error({"return": []})
184 check_error({"return": 80.1})
185 check_error({"return": 1000})
1import re
2import unittest
3from unit.applications.proto import TestApplicationProto
4
5
6class TestReturn(TestApplicationProto):
7 prerequisites = {}
8

--- 169 unchanged lines hidden (view full) ---

178 def test_return_invalid(self):
179 def check_error(conf):
180 self.assertIn('error', self.conf(conf, 'routes/0/action'))
181
182 check_error({"return": "200"})
183 check_error({"return": []})
184 check_error({"return": 80.1})
185 check_error({"return": 1000})
186 check_error({"return": -1})
186 check_error({"return": 200, "share": "/blah"})
187
188 self.assertIn(
189 'error', self.conf('001', 'routes/0/action/return'), 'leading zero'
190 )
191
192 check_error({"return": 301, "location": 0})
193 check_error({"return": 301, "location": []})
194
195
196if __name__ == '__main__':
197 TestReturn.main()
187 check_error({"return": 200, "share": "/blah"})
188
189 self.assertIn(
190 'error', self.conf('001', 'routes/0/action/return'), 'leading zero'
191 )
192
193 check_error({"return": 301, "location": 0})
194 check_error({"return": 301, "location": []})
195
196
197if __name__ == '__main__':
198 TestReturn.main()