Exemple #1
0
    def test_it_sets_custom_response_code(self):
        exc = exceptions.OAuthTokenError('boom', 'mytype', 500)

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

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

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

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