Skip to content

Commit 721d660

Browse files
authored
Merge pull request #4 from bencvdb/wfInfoAdd
Fix typo, bad var name. Add helpful testing lines.
2 parents 2310fd7 + 715cc69 commit 721d660

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

test/test_client_util.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ def testSupportedFormatChecking(self):
6161
This test is run only on local files to avoid downloading and removing a new file.
6262
"""
6363

64-
for format, location in self.local.items():
65-
if format != 'unsupported':
64+
for file_format, location in self.local.items():
65+
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[format])
68-
self.assertEquals(wf_info(location[7:]), self.expected[format])
67+
self.assertEquals(wf_info(location), self.expected[file_format])
68+
self.assertEquals(wf_info(location[7:]), self.expected[file_format])
6969

7070
else:
71-
# Tests behavior after recieveing a non supported file type.
71+
# Tests behavior after receiving a non supported file type.
7272
with self.assertRaises(TypeError):
7373
wf_info(location)
7474

@@ -79,20 +79,20 @@ def testFileLocationChecking(self):
7979
This test needs to be run on remote files to test the location checking functionality of wf_info().
8080
"""
8181

82-
for format, location in self.remote.items():
83-
if format == 'unsupported':
82+
for file_format, location in self.remote.items():
83+
if file_format == 'unsupported':
8484
# Tests behavior after receiving a file hosted at an unsupported location.
8585
with self.assertRaises(NotImplementedError):
8686
wf_info(location)
8787

88-
elif format == 'unreachable':
88+
elif file_format == 'unreachable':
8989
# Tests behavior after receiving a non-existent file.
9090
with self.assertRaises(IOError):
9191
wf_info(location)
9292

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

9797

9898
if __name__ == '__main__':

test/test_integration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
import signal
88
import shutil
99
import logging
10+
import sys
11+
12+
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
13+
sys.path.insert(0, pkg_root) # noqa
1014

1115
from wes_client.util import WESClient
1216

0 commit comments

Comments
 (0)