-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed userinfo regex for @ character in userinfo
- Loading branch information
can
committed
Sep 10, 2019
1 parent
2982509
commit 4ae4903
Showing
4 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,21 @@ def test_handles_uri_with_port_and_userinfo( | |
assert uri.fragment is None | ||
assert uri.userinfo == 'user:pass' | ||
|
||
def test_handles_uri_with_email_userinfo( | ||
self, uri_with_email_userinfo): | ||
""" | ||
Test that self.test_class can handle a URI with a port and userinfo. | ||
""" | ||
uri = self.test_class.from_string(uri_with_email_userinfo) | ||
assert uri.scheme == 'ssh' | ||
# 6 == len('ftp://') | ||
assert uri.authority == uri_with_email_userinfo[6:] | ||
assert uri.host != uri.authority | ||
assert uri.path is None | ||
assert uri.query is None | ||
assert uri.fragment is None | ||
assert uri.userinfo == '[email protected]:pass' | ||
|
||
def test_handles_tricky_userinfo( | ||
self, uri_with_port_and_tricky_userinfo): | ||
""" | ||
|
@@ -150,6 +165,11 @@ def test_uri_with_port_and_userinfo_unsplits(self, | |
uri = self.test_class.from_string(uri_with_port_and_userinfo) | ||
assert uri.unsplit() == uri_with_port_and_userinfo | ||
|
||
def test_uri_with_email_userinfo_unsplits(self, | ||
uri_with_email_userinfo): | ||
uri = self.test_class.from_string(uri_with_email_userinfo) | ||
assert uri.unsplit() == uri_with_email_userinfo | ||
|
||
def test_basic_uri_with_path_unsplits(self, basic_uri_with_path): | ||
uri = self.test_class.from_string(basic_uri_with_path) | ||
assert uri.unsplit() == basic_uri_with_path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,10 @@ def basic_uri_with_port(request): | |
def uri_with_port_and_userinfo(request): | ||
return 'ssh://user:pass@%s:22' % request.param | ||
|
||
@pytest.fixture(params=valid_hosts) | ||
def uri_with_email_userinfo(request): | ||
return 'ssh://[email protected]:pass@%s' % request.param | ||
|
||
|
||
@pytest.fixture(params=valid_hosts) | ||
def uri_with_port_and_tricky_userinfo(request): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters