File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,8 +125,11 @@ def __repr__(self):
125125
126126 @staticmethod
127127 def get_domain (url_string ):
128+ """
129+ Get the domain _including_ the protocol specified, if any.
130+ """
128131 if "://" in url_string :
129- return url_string .split ("/" )[2 ]
132+ return "/" . join ( url_string .split ("/" )[0 : 3 ])
130133 else :
131134 return url_string .split ("/" )[0 ]
132135
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ class URITest(unittest.TestCase):
117117
118118 def test_get_domain (self ):
119119 https_start = "https://github.com/edsu/microdata"
120- self .assertEqual ("github.com" , URI .get_domain (https_start ))
120+ self .assertEqual ("https:// github.com" , URI .get_domain (https_start ))
121121
122122 no_https = "github.com/edsu/microdata"
123123 self .assertEqual ("github.com" , URI .get_domain (no_https ))
You can’t perform that action at this time.
0 commit comments