Commit e660251a authored by Jérome Perrin's avatar Jérome Perrin

py3: use six.moves.urllib

parent 1bcc7f6a
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
import string import string
import random import random
import urllib import six.moves.urllib as urllib
import msgpack import msgpack
from six.moves.http_client import NO_CONTENT from six.moves.http_client import NO_CONTENT
...@@ -66,7 +66,7 @@ class TestDataIngestion(ERP5TypeTestCase): ...@@ -66,7 +66,7 @@ class TestDataIngestion(ERP5TypeTestCase):
body = msgpack.packb([0, data_chunk], use_bin_type=True) body = msgpack.packb([0, data_chunk], use_bin_type=True)
env = { "CONTENT_TYPE": "application/x-www-form-urlencoded" } env = { "CONTENT_TYPE": "application/x-www-form-urlencoded" }
body = str2bytes(urllib.urlencode({ "data_chunk": body })) body = str2bytes(urllib.parse.urlencode({ "data_chunk": body }))
if not isinstance(ingestion_policy, str): if not isinstance(ingestion_policy, str):
ingestion_policy = ingestion_policy.getPath() ingestion_policy = ingestion_policy.getPath()
......
...@@ -30,7 +30,7 @@ import string ...@@ -30,7 +30,7 @@ import string
import random import random
import struct import struct
import textwrap import textwrap
import urllib import six.moves.urllib as urllib
import uuid import uuid
from zExceptions import BadRequest from zExceptions import BadRequest
...@@ -100,7 +100,7 @@ class Test(ERP5TypeTestCase): ...@@ -100,7 +100,7 @@ class Test(ERP5TypeTestCase):
body = msgpack.packb([0, real_data], use_bin_type=True) body = msgpack.packb([0, real_data], use_bin_type=True)
if old_fluentd: if old_fluentd:
env = {'CONTENT_TYPE': 'application/x-www-form-urlencoded'} env = {'CONTENT_TYPE': 'application/x-www-form-urlencoded'}
body = urllib.urlencode({'data_chunk': body}) body = urllib.parse.urlencode({'data_chunk': body})
else: else:
env = {'CONTENT_TYPE': 'application/octet-stream'} env = {'CONTENT_TYPE': 'application/octet-stream'}
path = ingestion_policy.getPath() + '/ingest?reference=' + reference path = ingestion_policy.getPath() + '/ingest?reference=' + reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment