Ejemplo n.º 1
0
    def test_it_sets_custom_response_code(self):
        exc = exceptions.OAuthTokenError('boom', 'mytype', 500)

        assert exc.status_code == 500
Ejemplo n.º 2
0
    def test_it_sets_type_and_message(self):
        exc = exceptions.OAuthTokenError('boom', 'mytype')

        assert exc.type == 'mytype'
        assert str(exc) == 'boom'
Ejemplo n.º 3
0
    def test_it_sets_default_response_code(self):
        exc = exceptions.OAuthTokenError('boom', 'mytype')

        assert exc.status_code == 400
Ejemplo n.º 4
0
    def test_it_sets_type_and_message(self):
        exc = exceptions.OAuthTokenError("boom", "mytype")

        assert exc.type == "mytype"
        assert str(exc) == "boom"