Skip to content

Commit 4fd33f3

Browse files
committed
enhance test for obtain_file method to catch broken error reporting when file could not be downloaded
1 parent 4561545 commit 4fd33f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/framework/easyblock.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,12 @@ def test_obtain_file(self):
16941694
error_regex = "Couldn't find file %s anywhere, and downloading it didn't work either" % fn
16951695
self.assertErrorRegex(EasyBuildError, error_regex, eb.obtain_file, fn, urls=['file://%s' % tmpdir_subdir])
16961696

1697+
# also test triggering error when downloading from a URL that includes URL-encoded characters
1698+
# cfr. https://github.com/easybuilders/easybuild-framework/pull/4005
1699+
url = 'file://%s' % os.path.dirname(tmpdir_subdir)
1700+
url += '%2F' + os.path.basename(tmpdir_subdir)
1701+
self.assertErrorRegex(EasyBuildError, error_regex, eb.obtain_file, fn, urls=[url])
1702+
16971703
# file specifications via URL also work, are downloaded to (first) sourcepath
16981704
init_config(args=["--sourcepath=%s:/no/such/dir:%s" % (tmpdir, sandbox_sources)])
16991705
urls = [

0 commit comments

Comments
 (0)