(httpbin)
| 54 | |
| 55 | |
| 56 | def 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 | |
| 81 | def test_auth_plugin_require_auth_false_and_auth_provided(httpbin): |
nothing calls this directly
no test coverage detected