def test_needs_an_authorization_header(self): response = self.app.post( '/foo', data='[]', ) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())
def test_needs_an_authorization_header(self): response = self.app.post( '/foo', data='[]', ) assert_that( response, is_unauthorized()) assert_that( response, is_error_response())
def test_needs_an_authorization_header_even_if_no_token_is_configured(self): response = self.app.post( '/foo', data='[]', ) assert_that( response, is_unauthorized()) assert_that( response, is_error_response())
def test_authorization_header_must_match_server_side_value(self): response = self.app.post( '/foo', data='[]', headers=[('Authorization', 'Bearer not-foo-bearer-token')], ) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())
def test_authorization_header_must_be_correct_format(self): response = self.app.post( '/foo', data='[]', headers=[('Authorization', 'Bearer')], ) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())
def test_needs_an_authorization_header_even_if_no_token_is_configured( self): response = self.app.post( '/foo', data='[]', ) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())
def test_authorization_header_must_match_server_side_value(self): response = self.app.post( '/foo', data='[]', headers=[('Authorization', 'Bearer not-foo-bearer-token')], ) assert_that( response, is_unauthorized()) assert_that( response, is_error_response())
def test_authorization_header_must_be_correct_format(self): response = self.app.post( '/foo', data='[]', headers=[('Authorization', 'Bearer')], ) assert_that( response, is_unauthorized()) assert_that( response, is_error_response())
def test_authorization_header_must_match_server_side_value(self): response = self.app.post("/foo", data="[]", headers=[("Authorization", "Bearer not-foo-bearer-token")]) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())
def test_authorization_header_must_be_correct_format(self): response = self.app.post("/foo", data="[]", headers=[("Authorization", "Bearer")]) assert_that(response, is_unauthorized()) assert_that(response, is_error_response())