diff --git a/test/test_uri.py b/test/test_uri.py index a65d38d..69fabb7 100644 --- a/test/test_uri.py +++ b/test/test_uri.py @@ -278,7 +278,7 @@ def test_empty_protocol_assignment(self, empty): assert empty.scheme == 'http' empty.scheme = None - assert str(empty) == "example.com/over/there" + assert str(empty) == "//example.com/over/there" def test_bad_assignment(self, empty): with pytest.raises(AttributeError): diff --git a/uri/part/scheme.py b/uri/part/scheme.py index 150e065..6134385 100644 --- a/uri/part/scheme.py +++ b/uri/part/scheme.py @@ -37,6 +37,9 @@ def render(self, obj, value): if obj._scheme and obj.scheme.slashed: result = result + '//' + if not obj._scheme and obj.authority: + result = '//' + return result def __get__(self, obj, cls=None): diff --git a/uri/part/uri.py b/uri/part/uri.py index 0d8ac8e..3c8d958 100644 --- a/uri/part/uri.py +++ b/uri/part/uri.py @@ -22,9 +22,6 @@ def __get__(self, obj, cls=None): value = getattr(obj, part) part = getattr(cls, part) - if value is None: - continue - components.append(part.render(obj, value)) return "".join(components)