MCPcopy
hub / github.com/psf/requests / test_set_basicauth

Method test_set_basicauth

tests/test_requests.py:563–570  ·  tests/test_requests.py::TestRequests.test_set_basicauth
(self, httpbin, username, password)

Source from the content-addressed store, hash-verified

561 ),
562 )
563 def test_set_basicauth(self, httpbin, username, password):
564 auth = (username, password)
565 url = httpbin(class="st">"get")
566
567 r = requests.Request(class="st">"GET", url, auth=auth)
568 p = r.prepare()
569
570 assert p.headers[class="st">"Authorization"] == _basic_auth_str(username, password)
571
572 def test_basicauth_encodes_byte_strings(self):
573 class="st">""class="st">"Ensure b&class="cm">#x27;test' formats as the byte string "test" rather

Callers

nothing calls this directly

Calls 3

prepareMethod · 0.95
_basic_auth_strFunction · 0.90
httpbinFunction · 0.85

Tested by

no test coverage detected