PY3: Fix urllib path to be compatible with py3
Change-Id: If6a41b27dcda4c556d9b0ca7da58b847dc606f5c
This commit is contained in:
parent
e5f992afac
commit
9eb84a2282
tests/functional
@ -17,7 +17,7 @@
|
||||
from swiftclient import client as c
|
||||
from tests.functional.java import StorletJavaFunctionalTest
|
||||
import unittest
|
||||
from eventlet.green import urllib2
|
||||
from six.moves.urllib.request import Request, urlopen
|
||||
|
||||
|
||||
class TestThumbnailStorlet(StorletJavaFunctionalTest):
|
||||
@ -101,9 +101,9 @@ class TestThumbnailStorlet(StorletJavaFunctionalTest):
|
||||
'X-Object-Meta-Name': 'thumbnail',
|
||||
'Destination': '%s/gen_thumb_on_copy_.jpg' % self.container}
|
||||
headers.update(self.additional_headers)
|
||||
req = urllib2.Request(url, headers=headers)
|
||||
req = Request(url, headers=headers)
|
||||
req.get_method = lambda: 'COPY'
|
||||
conn = urllib2.urlopen(req, timeout=10)
|
||||
conn = urlopen(req, timeout=10)
|
||||
status = conn.getcode()
|
||||
self.assertIn(status, [201, 202])
|
||||
|
||||
|
@ -19,7 +19,7 @@ from swiftclient import client
|
||||
from nose.plugins.attrib import attr
|
||||
from tests.functional.python import StorletPythonFunctionalTest
|
||||
import unittest
|
||||
from eventlet.green import urllib2
|
||||
from six.moves.urllib.request import Request, urlopen
|
||||
from storlets.agent.common.utils import DEFAULT_PY3
|
||||
|
||||
|
||||
@ -136,9 +136,9 @@ class TestSimpleStorlet(StorletPythonFunctionalTest):
|
||||
'X-Run-Storlet': self.storlet_name,
|
||||
'Destination': '%s/%s' % (self.container, objname)}
|
||||
headers.update(self.additional_headers)
|
||||
req = urllib2.Request(url, headers=headers)
|
||||
req = Request(url, headers=headers)
|
||||
req.get_method = lambda: 'COPY'
|
||||
conn = urllib2.urlopen(req, timeout=10)
|
||||
conn = urlopen(req, timeout=10)
|
||||
|
||||
self.assertEqual(201, conn.getcode())
|
||||
self.assertEqual('%s/%s' % (self.container, self.storlet_file),
|
||||
|
Loading…
x
Reference in New Issue
Block a user