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

Method check_auth_required

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

Source from the content-addressed store, hash-verified

396
397
398 def check_auth_required(self):
399 self.log.info("Check that requests without credentials return 401 Unauthorized with WWW-Authenticate")
400 conn = BitcoinHTTPConnection(self.node)
401 conn.headers = {}
402 response = conn.post('/', '{"method": "getbestblockhash"}')
403 assert_equal(response.status, http.client.UNAUTHORIZED)
404 assert response.getheader('WWW-Authenticate') is not None
405
406
407 def check_wrong_credentials(self):

Callers 1

run_testMethod · 0.95

Calls 4

postMethod · 0.95
assert_equalFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected