From 0937d2b4e12ce34fb530c90d88b61663cdd8f205 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 19 Nov 2014 22:33:30 +0000 Subject: [PATCH] Use `urlencode` from six --- tests/unit/netapi/rest_cherrypy/test_tools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/netapi/rest_cherrypy/test_tools.py b/tests/unit/netapi/rest_cherrypy/test_tools.py index ce49b2c296..7b20c08d8b 100644 --- a/tests/unit/netapi/rest_cherrypy/test_tools.py +++ b/tests/unit/netapi/rest_cherrypy/test_tools.py @@ -1,8 +1,11 @@ # coding: utf-8 -import json -import urllib +# Import Python libs +import json + +# Import 3rd-party libs import yaml +from salt.ext.six.moves.urllib.parse import urlencode # pylint: disable=no-name-in-module,import-error from tests.utils import BaseToolsTest @@ -43,7 +46,7 @@ class TestInFormats(BaseToolsTest): def test_urlencoded_ctype(self): data = {'valid': 'stuff'} request, response = self.request('/', method='POST', - body=urllib.urlencode(data), headers=( + body=urlencode(data), headers=( ('Content-type', 'application/x-www-form-urlencoded'), )) self.assertEqual(response.status, '200 OK')