(httpbin)
| 108 | @mock.patch('httpie.cli.argtypes.AuthCredentials._getpass', |
| 109 | new=lambda self, prompt: 'UNEXPECTED_PROMPT_RESPONSE') |
| 110 | def 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) |
nothing calls this directly
no test coverage detected