Skip to content

Commit

Permalink
Added tests for rootless path assignment error.
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgregor committed Oct 31, 2018
1 parent 84e0787 commit 74a16f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_uri.py
Expand Up @@ -283,6 +283,17 @@ def test_empty_protocol_assignment(self, empty):
def test_bad_assignment(self, empty):
with pytest.raises(AttributeError):
empty.safe_uri = 'http://example.com'

def test_rooted_path_authority_resolution(self):
uri = URI('http://example.com/diz')
uri.path = '/foo/bar'
assert str(uri) == "http://example.com/foo/bar"

def test_rootless_path_authority_error(self):
uri = URI('http://example.com')

with pytest.raises(ValueError):
uri.path = 'foo/bar'


class TestURIDictlike(object):
Expand Down

0 comments on commit 74a16f6

Please sign in to comment.