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

Function test_auth_plugin_require_auth_false

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

Source from the content-addressed store, hash-verified

54
55
56def test_auth_plugin_require_auth_false(httpbin):
57
58 class Plugin(AuthPlugin):
59 auth_type = 'test-require-false'
60 auth_require = False
61
62 def get_auth(self, username=None, password=None):
63 assert self.raw_auth is None
64 assert username is None
65 assert password is None
66 return basic_auth()
67
68 plugin_manager.register(Plugin)
69 try:
70 r = http(
71 httpbin + BASIC_AUTH_URL,
72 '--auth-type',
73 Plugin.auth_type,
74 )
75 assert HTTP_OK in r
76 assert r.json == AUTH_OK
77 finally:
78 plugin_manager.unregister(Plugin)
79
80
81def test_auth_plugin_require_auth_false_and_auth_provided(httpbin):

Callers

nothing calls this directly

Calls 3

httpFunction · 0.85
registerMethod · 0.80
unregisterMethod · 0.80

Tested by

no test coverage detected