/usr/lib/python2.6/site-packages/jsonschema/tests
Edit: /usr/lib/python2.6/site-packages/jsonschema/tests/test_format.pyc (3496B)
Ñò
DVc @ se d Z d d k l Z l Z d d k l Z l Z l Z d d k l Z d e i
f d „ ƒ YZ d S( sQ
Tests for the parts of jsonschema related to the :validator:`format` property.
iÿÿÿÿ( t mockt unittest( t FormatErrort ValidationErrort
FormatChecker( t Draft4Validatort TestFormatCheckerc B sG e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( c C s t i ƒ | _ d S( N( R t Mockt fn( t self( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt setUp
s c C s# t d d ƒ } | i | i ƒ d S( Nt formats( ( R t assertFalset checkers( R t checker( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt test_it_can_validate_no_formats s c C s5 | i t ƒ i i ƒ z t d d g ƒ Wd QXd S( NR s o noes( t assertRaisest KeyErrort __exit__t __enter__R ( R ( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt. test_it_raises_a_key_error_for_unknown_formats s c C sj t i i t i d t ƒi i ƒ z= t i d ƒ | i ƒ | i
t i h | i d f d 6ƒ Wd QXd S( Nt cleart new( ( R t patcht dictR R
t TrueR R t
cls_checksR t assertEqual( R ( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt! test_it_can_register_cls_checkers s 'c C sN t ƒ } | i d ƒ | i ƒ | i | i t t i d | i d f ƒƒ d S( NR ( ( R t checksR R R
R ( R R ( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt test_it_can_register_checkers s
c
C sá t ƒ } t ƒ } | i _ | i d d t ƒ| i ƒ | i t ƒ i i ƒ } z | ~ } | i d d ƒ Wd QX| i
| i i | ƒ | i
| i i
| ƒ t | i _ | i t ƒ i i ƒ z | i d d ƒ Wd QXd S( Nt foot raisest bar( R t
ValueErrorR t side_effectR R R R R t checkt assertIst exceptiont causet __cause__t AttributeError( R R R' t _[1]t cm( ( s@ /tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_format.pyt! test_it_catches_registered_errors% s &c C s¤ t ƒ } | i d d t ƒ| i ƒ t ƒ } | i _ t h d d 6d | ƒ} | i t ƒ i i ƒ } z | ~ } | i
d ƒ Wd QX| i | i i
| ƒ d S( NR R t formatt format_checkerR! ( R R R" R R# R R R R R t validateR% R&