MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_suburi

Method is_suburi

Lib/urllib/request.py:852–864  ·  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

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

Callers 2

find_user_passwordMethod · 0.95
is_authenticatedMethod · 0.80

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected