Skip to content

Commit dec5440

Browse files
authored
Merge pull request #451 from common-workflow-language/fix_tests
fix tests to work with unreleased schema_salad
2 parents 02ba0d7 + c43a320 commit dec5440

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/test_fetch.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import unittest
22

3+
from six.moves import urllib
4+
35
import schema_salad.main
46
import schema_salad.ref_resolver
57
import schema_salad.schema
@@ -32,6 +34,16 @@ def check_exists(self, url): # type: (unicode) -> bool
3234
else:
3335
return False
3436

37+
def urljoin(self, base, url):
38+
urlsp = urllib.parse.urlsplit(url)
39+
if urlsp.scheme:
40+
return url
41+
basesp = urllib.parse.urlsplit(base)
42+
43+
if basesp.scheme == "keep":
44+
return base + "/" + url
45+
return urllib.parse.urljoin(base, url)
46+
3547
def test_resolver(d, a):
3648
return "baz:bar/" + a
3749

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
#envlist = py27-lint, py27-unit, py27-pipconflictchecker, py33-lint, py33-unit, py34-lint, py34-unit, py35-py2_mypy, py35-mypy, py35-lint, py35-unit, py36-lint, py36-unit # only when py3 compat is done
3-
envlist = py27-lint, py27-unit, py27-pipconflictchecker, py36-lint, py35-lint, py34-lint, py33-lint
3+
envlist = py27-lint, py27-unit, py27-pipconflictchecker, py36-lint, py35-lint, py34-lint, py33-lint, py35-py2_mypy
44
skipsdist = True
55

66
[travis]

0 commit comments

Comments
 (0)