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

Function test_auth_plugin_prompt_password_false

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

Source from the content-addressed store, hash-verified

108@mock.patch('httpie.cli.argtypes.AuthCredentials._getpass',
109 new=lambda self, prompt: 'UNEXPECTED_PROMPT_RESPONSE')
110def test_auth_plugin_prompt_password_false(httpbin):
111
112 class Plugin(AuthPlugin):
113 auth_type = 'test-prompt-false'
114 prompt_password = False
115
116 def get_auth(self, username=None, password=None):
117 assert self.raw_auth == USERNAME
118 assert username == USERNAME
119 assert password is None
120 return basic_auth()
121
122 plugin_manager.register(Plugin)
123
124 try:
125 r = http(
126 httpbin + BASIC_AUTH_URL,
127 '--auth-type',
128 Plugin.auth_type,
129 '--auth',
130 USERNAME,
131 )
132 assert HTTP_OK in r
133 assert r.json == AUTH_OK
134 finally:
135 plugin_manager.unregister(Plugin)

Callers

nothing calls this directly

Calls 3

httpFunction · 0.85
registerMethod · 0.80
unregisterMethod · 0.80

Tested by

no test coverage detected