(httpbin)
| 27 | |
| 28 | |
| 29 | def 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 | |
| 56 | def test_auth_plugin_require_auth_false(httpbin): |
nothing calls this directly
no test coverage detected