/usr/lib/python2.6/site-packages/jsonschema/tests
NameSizeModeActions
compat.py2150644editdlrm
compat.pyc3910644editdlrm
test_cli.py35750644editdlrm
test_cli.pyc47200644editdlrm
test_exceptions.py133920644editdlrm
test_exceptions.pyc153610644editdlrm
test_format.py21500644editdlrm
test_format.pyc34960644editdlrm
test_jsonschema_test_suite.py96440644editdlrm
test_jsonschema_test_suite.pyc133780644editdlrm
test_validators.py332100644editdlrm
test_validators.pyc376890644editdlrm
__init__.py00644editdlrm
__init__.pyc1480644editdlrm
Edit: /usr/lib/python2.6/site-packages/jsonschema/tests/test_exceptions.pyc (15361B)
Ñò DVc@s°ddkZddklZlZddklZddklZlZdei fd„ƒYZ dei fd„ƒYZ d ei fd „ƒYZ d ei fd „ƒYZ dS( iÿÿÿÿN(tDraft4Validatort exceptions(tPY3(tmocktunittestt TestBestMatchcBsYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( cCsVt|ƒ}ti|ƒ}tit|ƒƒ}|i||ddi||ƒƒ|S(Ntmsgs:Didn't return a consistent best match! Got: {0} Then: {1}(tlistRt best_matchtreversedt assertEqualtformat(tselfterrorstbestt reversed_best((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyR s  cCssthhhdd6hhdd6d6d6d6d6ƒ}|i|ihhgd6d6ƒƒ}|i|idƒdS(Nit minPropertiestobjectttypetbart propertiestfoo(RRt iter_errorsR t validator(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt(test_shallower_errors_are_better_matchess#&cCsxthdd6hdd6hdd6gd6hdd6hdd6gd6ƒ}|i|ihƒƒ}|i|idƒdS( so A property you *must* match is probably better than one you have to match a part of. iRtstringRtnumbertanyOftoneOfN(RRRR R(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt%test_oneOf_and_anyOf_are_weak_matches#s!c Cs€thhhhdd6hhhdd6d6d6gd6d6d6ƒ}|i|ihhdd6d6ƒƒ}|i|idƒd S( sM If the most relevant error is an anyOf, then we traverse its context and select the otherwise *least* relevant error, since in this case that means the most specific, deep, error inside the instance. I.e. since only one of the schemas must match, we look for the most relevant one. RRtarrayRRRRi N(RRRR tvalidator_value(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt8test_if_the_most_relevant_error_is_anyOf_it_is_traversed4s  -&c Cs€thhhhdd6hhhdd6d6d6gd6d6d6ƒ}|i|ihhdd6d6ƒƒ}|i|idƒd S( sM If the most relevant error is an oneOf, then we traverse its context and select the otherwise *least* relevant error, since in this case that means the most specific, deep, error inside the instance. I.e. since only one of the schemas must match, we look for the most relevant one. RRRRRRRi N(RRRR R(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt8test_if_the_most_relevant_error_is_oneOf_it_is_traversedNs  -&c Cs€thhhhdd6hhhdd6d6d6gd6d6d6ƒ}|i|ihhdd6d6ƒƒ}|i|idƒd S( s¦ Now, if the error is allOf, we traverse but select the *most* relevant error from the context, because all schemas here must match anyways. RRRRRtallOfRi N(RRRR R(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt8test_if_the_most_relevant_error_is_allOf_it_is_traversedhs -&c Cs”thhhhdd6hhdd6hhhdd6d6d6gd6gd6d6d6ƒ}|i|ihhdd6d6ƒƒ}|i|idƒdS( NRRRRRRRi (RRRR R(R RR((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_nested_context_for_oneOf~s  . &cCsNthdd6ƒ}|ihƒ\}|iti|ihƒƒidƒdS(NiR(RRR RRR(R Rterror((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_one_error—s cCs/thƒ}|iti|ihƒƒƒdS(N(Rt assertIsNoneRRR(R R((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_no_errorsŸs ( t__name__t __module__RRRR R!R#R$R&R((((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyRs       tTestByRelevancecBs,eZd„Zd„Zd„Zd„ZRS(cCstidddgƒ}tiddddgƒ}t||gdtiƒ}|i||ƒt||gdtiƒ}|i||ƒdS(NsOh no!tpathtbazsOh yes!RRtkey(RtValidationErrortmaxt relevancetassertIs(R tshallowtdeeptmatch((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt#test_short_paths_are_better_matches¥s cCsátiddgƒ}tidddgƒ}t||gdtiƒ}|ig}|D]}|t|iƒqY~dgggƒt||gdtiƒ}|ig}|D]}|t|iƒq±~dgggƒdS(NsOh no!R,sOh yes!RR.(RR/tsortedR1R RR,(R R3R4R t_[1]R%t_[2]((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt*test_global_errors_are_even_better_matches®s''cCsœtiddgddƒ}tiddgddƒ}tiddƒ}t||gd|ƒ}|i||ƒt||gd|ƒ}|i||ƒdS( NsOh no!R,RtasOh yes!tbtweakR.(RR/t by_relevanceR0R2(R R=tnormalRR5((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt'test_weak_validators_are_lower_priority¾scCsÃtiddgddƒ}tiddgddƒ}tiddgddƒ}tid dd dƒ}t|||gd |ƒ}|i||ƒt|||gd |ƒ}|i||ƒdS( NsOh no!R,RR;sOh yes!R<sOh fine!tcR=tstrongR.(RR/R>R0R2(R R=R?RBRR5((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt*test_strong_validators_are_higher_priorityÊs(R)R*R6R:R@RC(((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyR+¤s  t TestErrorTreecBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(cCsSg}tdƒD]}|tiƒq~}ti|ƒ}|i|idƒdS(Ni(trangeRt MagicMockRt ErrorTreeR t total_errors(R R8t_R ttree((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt/test_it_knows_how_many_total_errors_it_containsÙs-cCs>tidddgƒg}ti|ƒ}|id|ƒdS(Ns a messageR,R(RR/RGtassertIn(R R RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt1test_it_contains_an_item_if_the_item_had_an_errorÞscCs>tidddgƒg}ti|ƒ}|id|ƒdS(Ns a messageR,RR(RR/RGt assertNotIn(R R RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt9test_it_does_not_contain_an_item_if_the_item_had_no_errorãscCsEtidddƒ}ti|gƒ}|i|ih|d6ƒdS(Ns a messageRR(RR/RGR R (R R%RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt1test_validators_that_failed_appear_in_errors_dictèscCsntidddgƒtiddddgƒg}ti|ƒ}|id|dƒ|id|dƒdS(Ns a bar messageR,Rsa bar -> 0 messageii(RR/RGRLRN(R R RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt1test_it_creates_a_child_tree_for_each_nested_pathís cCs…tiddddddgƒtiddddddgƒ}}ti||gƒ}|i|ddih|d6|d6ƒdS( Nt1RRR,Rit2tquux(RR/RGR R (R te1te2RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt+test_children_have_their_errors_dicts_builtös%cCsZtiddddgƒ}ti|gƒ}|itƒiiƒz |dWdQXdS(Nt123RRtinstancei(RR/RGt assertRaisest IndexErrort__exit__t __enter__(R R%RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt>test_it_does_not_contain_subtrees_that_are_not_in_the_instanceþscCsQtiddddhddgƒ}ti|gƒ}|i|dtiƒdS(sË If a validator is dumb (like :validator:`required` in draft 3) and refers to a path that isn't in the instance, the tree still properly returns a subtree for that path. s a messageRRRYR,N(RR/RGtassertIsInstance(R R%RJ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt9test_if_its_in_the_tree_anyhow_it_does_not_raise_an_errors( R)R*RKRMRORPRQRWR^R`(((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyRDØs      tTestErrorInitReprStrcBsbeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( c KsHtddddddddd hdd6ƒ}|i|ƒti|S( NtmessageuhelloRutypeRustringRYitschema(tdicttupdateRR/(R tkwargstdefaults((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt make_errors cKs‰to|iddƒ}nti|ƒidƒ}|i|}t|ƒidƒ\}}}|i||i ƒ|i||ƒdS(Nsu't's ( RtreplacettextwraptdedenttrstripRhtstrt partitionR Rb(R texpectedRfR%t message_lineRItrest((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt assertShows scCs)|iƒ}|it|iƒdƒdS(Ni(Rht assertGreatertlentargs(R R%((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt!test_it_calls_super_and_sets_args*s cCs*|ittiddƒƒddƒdS(NRbsHello!s(R treprRR/(R ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt test_repr.scCsžtidƒ}|it|ƒdƒhdd6dd6dd6hdd6d6}xI|D]A}t|ƒ}||=tid|}|it|ƒdƒqUWdS( NRbRRRRiRYRc(RR/R RnRd(R R%Rftattrtk((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_unset_error4s cCs|iddgdgƒdS(Ns Failed validating u'type' in schema: {u'type': u'string'} On instance: 5 R,t schema_path(Rs(R ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_empty_pathsEscCs#|idddgddgƒdS(Ns’ Failed validating u'type' in schema: {u'type': u'string'} On instance[0]: 5 R,iR}titems(Rs(R ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_one_item_pathsRs cCs,|iddddgddddgƒdS(Ns¥ Failed validating u'type' in schema[u'items'][0]: {u'type': u'string'} On instance[0][u'a']: 5 R,iuaR}uitemsi(Rs(R ((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_multiple_item_paths_s cCsStidƒiiƒ}z0|~}t|iƒƒ|i|idƒWdQXdS(Nspprint.pformati(RtpatchR\R]RnRhR t call_count(R R8tpformat((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyttest_uses_pprintls&c CsTtiƒ}tidddd|ddddƒ}t|ƒ|i|iiƒdS( sà Check for https://github.com/Julian/jsonschema/issues/164 which rendered exceptions unusable when a `ValidationError` involved instances with an `__eq__` method that returned truthy values. s a messageRRRYRtsomeRcN(RRFRR/Rnt assertFalset__eq__tcalled(R RYR%((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyt:test_str_works_with_instances_having_overriden_eq_operatorqs   ( R)R*RhRsRwRyR|R~R€RR…RŠ(((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyRas    (Rkt jsonschemaRRtjsonschema.compatRtjsonschema.tests.compatRRtTestCaseRR+RDRa(((sD/tmp/pip-build-lt8jXN/jsonschema/jsonschema/tests/test_exceptions.pyts œ4<