Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 3
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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 9
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())
Exemplo n.º 10
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())