Skip to content

Commit 66eeb63

Browse files
committed
properly fix, more py3 compat
1 parent 134d08d commit 66eeb63

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

test/test_client_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def testSupportedFormatChecking(self):
6464
for file_format, location in self.local.items():
6565
if file_format != 'unsupported':
6666
# Tests the behavior after receiving supported file types with and without the 'file://' prefix
67-
self.assertEquals(wf_info(location), self.expected[file_format])
68-
self.assertEquals(wf_info(location[7:]), self.expected[file_format])
67+
self.assertEqual(wf_info(location), self.expected[file_format])
68+
self.assertEqual(wf_info(location[7:]), self.expected[file_format])
6969

7070
else:
7171
# Tests behavior after receiving a non supported file type.
@@ -91,7 +91,7 @@ def testFileLocationChecking(self):
9191
wf_info(location)
9292

9393
else:
94-
self.assertEquals(wf_info(location), self.expected[file_format])
94+
self.assertEqual(wf_info(location), self.expected[file_format])
9595
self.assertFalse(os.path.isfile(os.path.join(os.getcwd(), 'fetchedFromRemote.' + file_format)))
9696

9797

wes_client/util.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
import yaml
66
import glob
77
import requests
8-
import urllib
98
import logging
109

1110
from wes_service.util import visit
1211

1312
from future.standard_library import hooks
1413

1514
with hooks():
16-
from urllib.request import pathname2url
15+
from urllib.request import urlopen, pathname2url
1716

1817

1918
def two_seven_compatible(filePath):
@@ -60,7 +59,7 @@ def wf_info(workflow_path):
6059
html = urlopen(workflow_path).read()
6160
local_loc = os.path.join(os.getcwd(), 'fetchedFromRemote.' + file_type)
6261
with open(local_loc, 'w') as f:
63-
f.write(html)
62+
f.write(html.decode())
6463
version = wf_info('file://' + local_loc)[0] # Don't take the file_type here, found it above.
6564
os.remove(local_loc) # TODO: Find a way to avoid recreating file before version determination.
6665
else:
@@ -90,7 +89,7 @@ def fixpaths(d):
9089
if "path" in d:
9190
if ":" not in d["path"]:
9291
local_path = os.path.normpath(os.path.join(os.getcwd(), basedir, d["path"]))
93-
d["location"] = urllib.pathname2url(local_path)
92+
d["location"] = pathname2url(local_path)
9493
else:
9594
d["location"] = d["path"]
9695
del d["path"]

0 commit comments

Comments
 (0)