MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / check_wrong_credentials

Method check_wrong_credentials

test/functional/interface_http.py:407–414  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

405
406
407 def check_wrong_credentials(self):
408 self.log.info("Check that incorrect credentials return 401 Unauthorized")
409 conn = BitcoinHTTPConnection(self.node)
410 wrong_pair = f"{conn.url.username}:wrong_password"
411 conn.headers = {"Authorization": f"Basic {str_to_b64str(wrong_pair)}"}
412 response = conn.post('/', '{"method": "getbestblockhash"}')
413 assert_equal(response.status, http.client.UNAUTHORIZED)
414 assert response.getheader('WWW-Authenticate') is not None
415
416
417 def check_malformed_auth_headers(self):

Callers 1

run_testMethod · 0.95

Calls 5

postMethod · 0.95
str_to_b64strFunction · 0.90
assert_equalFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected