Mercurial > p > roundup > code
comparison test/test_cgi.py @ 5703:92c1864d5dd2
Add test for @pretty=false format change.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 10 Apr 2019 18:04:36 -0400 |
| parents | f90a534cb112 |
| children | 071625b5b7c0 |
comparison
equal
deleted
inserted
replaced
| 5702:61874fd78ced | 5703:92c1864d5dd2 |
|---|---|
| 1094 cl.write = wh # capture output | 1094 cl.write = wh # capture output |
| 1095 | 1095 |
| 1096 # Should work as all required headers are present. | 1096 # Should work as all required headers are present. |
| 1097 cl.handle_rest() | 1097 cl.handle_rest() |
| 1098 answer='{"data": {"link": "http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/issue/1", "id": "1"}}\n' | 1098 answer='{"data": {"link": "http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/issue/1", "id": "1"}}\n' |
| 1099 # check length to see if pretty is turned off. | |
| 1100 self.assertEqual(len(out[0]), 99) | |
| 1101 | |
| 1102 # compare as dicts not strings due to different key ordering | |
| 1103 # between python versions. | |
| 1099 response=json.loads(b2s(out[0])) | 1104 response=json.loads(b2s(out[0])) |
| 1100 expected=json.loads(answer) | 1105 expected=json.loads(answer) |
| 1101 self.assertEqual(response,expected) | 1106 self.assertEqual(response,expected) |
| 1102 del(out[0]) | 1107 del(out[0]) |
| 1103 | 1108 |
