Example #1
0
    def test_needs_an_authorization_header(self):
        response = self.app.post(
            '/foo',
            data='[]',
        )

        assert_that(response, is_unauthorized())
        assert_that(response, is_error_response())
Example #2
0
    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())
Example #4
0
    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())
Example #5
0
    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())
Example #6
0
    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())
Example #7
0
    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())
Example #8
0
    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())