MCPcopy Index your code
hub / github.com/python/cpython / is_suburi

Method is_suburi

Lib/urllib/request.py:854–866  ·  view source on GitHub ↗

Check if test is below base in a URI tree Both args must be URIs in reduced form.

(self, base, test)

Source from the content-addressed store, hash-verified

852 return authority, path
853
854 def is_suburi(self, base, test):
855 """Check if test is below base in a URI tree
856
857 Both args must be URIs in reduced form.
858 """
859 if base == test:
860 return True
861 if base[0] != test[0]:
862 return False
863 prefix = base[1]
864 if prefix[-1:] != '/':
865 prefix += '/'
866 return test[1].startswith(prefix)
867
868
869class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr):

Callers 2

find_user_passwordMethod · 0.95
is_authenticatedMethod · 0.80

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected