Browse Source

Keep py3.X compatibility for urllib.urlencode

For py3.X, urllib has no attr urlencode while python 2 has.
Change urlencode to keep compatibility.

Partial-Bug: #1280105

Change-Id: I2c0447af3206cdfc55ba22748b2793de8eb94cfb
tags/2014.1.b3
Fengqian Gao 6 years ago
parent
commit
18027816d3
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      ceilometer/tests/api/__init__.py

+ 2
- 3
ceilometer/tests/api/__init__.py View File

@@ -18,11 +18,10 @@
"""Base classes for API tests.
"""

import urllib

import flask
import pecan
import pecan.testing
from six.moves import urllib

from ceilometer.api import acl
from ceilometer.api.v1 import app as v1_app
@@ -61,7 +60,7 @@ class TestBase(db_test_base.TestBase):

def get(self, path, headers=None, **kwds):
if kwds:
query = path + '?' + urllib.urlencode(kwds)
query = path + '?' + urllib.parse.urlencode(kwds)
else:
query = path
rv = self.test_app.get(query, headers=headers)

Loading…
Cancel
Save