MCPcopy
hub / github.com/httpie/cli / test_auth_plugin_parse_auth_false

Function test_auth_plugin_parse_auth_false

tests/test_auth_plugins.py:29–53  ·  view source on GitHub ↗
(httpbin)

Source from the content-addressed store, hash-verified

27
28
29def test_auth_plugin_parse_auth_false(httpbin):
30
31 class Plugin(AuthPlugin):
32 auth_type = 'test-parse-false'
33 auth_parse = False
34
35 def get_auth(self, username=None, password=None):
36 assert username is None
37 assert password is None
38 assert self.raw_auth == BASIC_AUTH_HEADER_VALUE
39 return basic_auth(self.raw_auth)
40
41 plugin_manager.register(Plugin)
42 try:
43 r = http(
44 httpbin + BASIC_AUTH_URL,
45 '--auth-type',
46 Plugin.auth_type,
47 '--auth',
48 BASIC_AUTH_HEADER_VALUE,
49 )
50 assert HTTP_OK in r
51 assert r.json == AUTH_OK
52 finally:
53 plugin_manager.unregister(Plugin)
54
55
56def test_auth_plugin_require_auth_false(httpbin):

Callers

nothing calls this directly

Calls 3

httpFunction · 0.85
registerMethod · 0.80
unregisterMethod · 0.80

Tested by

no test coverage detected