diff options
author | Gustavo Picon <tabo@tabo.pe> | 2014-01-11 16:02:54 -0500 |
---|---|---|
committer | Gustavo Picon <tabo@tabo.pe> | 2014-01-11 16:02:54 -0500 |
commit | b21c49862777140abe49fc819feabe5904122364 (patch) | |
tree | 32551399471ea42b46c64eb725fc0f565672e289 | |
parent | 6d82937585b1985ff8b256dadf5ba8e48f96c4d3 (diff) | |
download | cherrypy-git-b21c49862777140abe49fc819feabe5904122364.tar.gz |
broken dictionary based tests should be deterministic
-rw-r--r-- | cherrypy/test/test_encoding.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cherrypy/test/test_encoding.py b/cherrypy/test/test_encoding.py index 055bfc06..e130ecee 100644 --- a/cherrypy/test/test_encoding.py +++ b/cherrypy/test/test_encoding.py @@ -43,8 +43,10 @@ class EncodingTests(helper.CPWebCase): cookies_and_headers.exposed = True def reqparams(self, *args, **kwargs): - return ntob(', ').join([": ".join((k, v)).encode('utf8') - for k, v in cherrypy.request.params.items()]) + return ntob(', ').join( + [": ".join((k, v)).encode('utf8') + for k, v in sorted(cherrypy.request.params.items())] + ) reqparams.exposed = True def nontext(self, *args, **kwargs): @@ -218,7 +220,7 @@ class EncodingTests(helper.CPWebCase): ("Content-Length", str(len(body))), ], body=body), - self.assertBody(ntob("text: ab\xe2\x80\x9cc, submit: Create")) + self.assertBody(ntob("submit: Create, text: ab\xe2\x80\x9cc")) def test_multipart_decoding_no_charset(self): # Test the decoding of a multipart entity when the charset (utf8) is @@ -237,7 +239,7 @@ class EncodingTests(helper.CPWebCase): ("Content-Length", str(len(body))), ], body=body), - self.assertBody(ntob("text: \xe2\x80\x9c, submit: Create")) + self.assertBody(ntob("submit: Create, text: \xe2\x80\x9c")) def test_multipart_decoding_no_successful_charset(self): # Test the decoding of a multipart entity when the charset (utf16) is |