Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
Get rid of dependency on jsonschema
Browse files Browse the repository at this point in the history
  • Loading branch information
palankai committed Aug 23, 2015
1 parent 805c396 commit 1f7e14e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions pyrs/resource/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect

import jsonschema
import werkzeug

from . import lib
Expand Down Expand Up @@ -90,8 +89,6 @@ def handle_exception(self, ex, opts, req):
return res

def transform_exception(self, ex):
if isinstance(ex, jsonschema.exceptions.ValidationError):
return errors.ValidationError(cause=ex)
return ex

def add_rule(self, rule):
Expand Down
5 changes: 4 additions & 1 deletion pyrs/resource/tests/test_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def test_get_user_by_name_invalid_response(self):

content, status, headers = self.app.dispatch('/user/invalid', 'GET')
self.assertEqual(status, 500)
self.assertEqual(json.loads(content), {'error': 'validation_error'})
self.assertEqual(
json.loads(content)['error'],
'jsonschema.exceptions.ValidationError'
)

def test_invalid_request(self):

Expand Down

0 comments on commit 1f7e14e

Please sign in to comment.