Skip to content

Commit bb5f105

Browse files
committed
Merge remote-tracking branch 'upstream/master' into unicode_literal_usage
2 parents 932464d + dec5440 commit bb5f105

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/test_fetch.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from __future__ import absolute_import
44
import unittest
55

6+
from six.moves import urllib
7+
68
import schema_salad.main
79
import schema_salad.ref_resolver
810
import schema_salad.schema
@@ -35,6 +37,16 @@ def check_exists(self, url): # type: (unicode) -> bool
3537
else:
3638
return False
3739

40+
def urljoin(self, base, url):
41+
urlsp = urllib.parse.urlsplit(url)
42+
if urlsp.scheme:
43+
return url
44+
basesp = urllib.parse.urlsplit(base)
45+
46+
if basesp.scheme == "keep":
47+
return base + "/" + url
48+
return urllib.parse.urljoin(base, url)
49+
3850
def test_resolver(d, a):
3951
return "baz:bar/" + a
4052

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27-lint, py27-unit, py27-pipconflictchecker, py36-lint, py35-lint, py34-lint, py33-lint
2+
envlist = py27-lint, py27-unit, py27-pipconflictchecker, py36-lint, py35-lint, py34-lint, py33-lint, py35-mypy2
33
skipsdist = True
44

55
[travis]

0 commit comments

Comments
 (0)