3 F\@sddlmZddlmZddlZddlmZmZddlm Z m Z ddl m Z m Z mZmZmZmZmZmZmZGddde jZGd d d e jZGd d d e jZGd dde jZGdddeZGdddee jZGdddee jZGddde jZx:ejD]0Z e fddZ!dj e Z"e"e!_#e$ee"e![!qWGddde jZ%Gddde jZ&Gddde jZ'Gd d!d!eZ(Gd"d#d#e(e jZ)Gd$d%d%e(e jZ*d&d'Z+dS)()deque)contextmanagerN) FormatCheckerValidationError)mockunittest) RefResolutionError UnknownTypeDraft3ValidatorDraft4Validator RefResolvercreateextend validator_forvalidatec@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)TestCreateAndExtendcCshddiii|_tj|_d|ji|_dti|_t|j|j|jd|_d|_ d|j i|_ |j|j |_ dS)N propertiessmellydict) meta_schema validatorsZ default_types ) rrZ MagicMockrrrtypesr Validatorvalidator_valueschema validator)selfr|/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-install-emcbgzcf/jsonschema/jsonschema/tests/test_validators.pysetUps     zTestCreateAndExtend.setUpcCs:|j|jj|j|j|jj|j|j|jj|jdS)N) assertEqualr VALIDATORSr META_SCHEMAr DEFAULT_TYPESr)rrrr test_attrsszTestCreateAndExtend.test_attrscCs|j|jj|jdS)N)r!rr)rrrr test_init"szTestCreateAndExtend.test_initcCsld}g|j_|jt|jj|gtj}|g|j_|jt|jj||g|jj|j|j ||j dS)NZhello) r return_valuer!listr iter_errorsrMockZassert_called_withrr)rinstanceerrorrrrtest_iter_errors%s z$TestCreateAndExtend.test_iter_errorsc CsLtjd }dd|_tddidd}WdQRX|jd|j|jddS) Nzjsonschema.validators.validatescSsddS)NcSs|S)Nr)clsrrr5szfTestCreateAndExtend.test_if_a_version_is_provided_it_is_registered....r)versionrrrr/5szTTestCreateAndExtend.test_if_a_version_is_provided_it_is_registered..idz my version)rr0ZMyVersionValidator)rpatch side_effectr assert_called_once_withr!__name__)r validatesrrrr.test_if_a_version_is_provided_it_is_registered3s    zBTestCreateAndExtend.test_if_a_version_is_provided_it_is_registeredc Cs4tjd}tddidWdQRX|j|jdS)Nzjsonschema.validators.validatesr1)r)rr3r assertFalsecalled)rr7rrr6test_if_a_version_is_not_provided_it_is_not_registered:s zJTestCreateAndExtend.test_if_a_version_is_not_provided_it_is_not_registeredcCs|t|jj}tj}t|jd|id}|jd|fg|j|j||jd|jj|j|j |jj |j|j |jj dS)Nz a new one)r) rrr"rr*rupdater!Z assertNotInr#r$)rrnewZExtendedrrr test_extend?s zTestCreateAndExtend.test_extendN) r6 __module__ __qualname__r r%r&r-r8r;r>rrrrr src@s$eZdZddZddZddZdS)TestIterErrorscCsti|_dS)N)r r)rrrrr NszTestIterErrors.setUpcCsrddg}ddddgddd ggd d }d d |jj||D}d|dfdd|dfg}|jt|t|dS)Narrayabcdef)disallowenumminItemscss|] }|jVqdS)N)message).0rIrrr Ysz2TestIterErrors.test_iter_errors..z%r is disallowed for [1, 2]rLz[1, 2] is too shortz[1, 2] is not one of %rrM)rr)r!sorted)rr+rgotexpectedrrrr-Qs zTestIterErrors.test_iter_errorscCs\ddgddd}dddid did dd d d gddi}t|jj||}|jt|d dS)NrCrBspam)foobarbazquuxrtypestringrN )maximumrM)rWrXrY)r(rr)r!len)rr+rerrorsrrr0test_iter_errors_multiple_failures_one_validatorasz?TestIterErrors.test_iter_errors_multiple_failures_one_validatorN)r6r?r@r r-rdrrrrrAMsrAc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdS) TestValidationErrorMessagesc Os<|jdt|jt}t||f||WdQRX|jjS)Nr.) setdefaultr assertRaisesrr exceptionrO)rr+rargskwargsrIrrr message_forps  z'TestValidationErrorMessages.message_forcCs&|jdddid}|j|dddS)NrBr[r\)r+rz1 is not of type %r)rkr!)rrOrrrtest_single_type_failurevsz4TestValidationErrorMessages.test_single_type_failurecCs(|jdddgid}|j|dddS)NrBr[r\)r+rz1 is not of type %r)rkr!)rrOrrrtest_single_type_list_failurezsz9TestValidationErrorMessages.test_single_type_list_failurecCs.d}|jddt|id}|j|d|dS)Nr\objectrBr[)r+rz1 is not of type %r, %r)r\rn)rkr(r!)rrrOrrrtest_multiple_type_failure~sz6TestValidationErrorMessages.test_multiple_type_failurecCs8dddigi}|jdd|gid}|j|d|fdS)Nr[minimumrKrB)r+rz1 is not of type %r)rkr!)rr[rOrrr&test_object_without_title_type_failureszBTestValidationErrorMessages.test_object_without_title_type_failurecCs8d}d|ddgi}|jd|d}|j|d|fdS)NZFoor[rK)namerprB)r+rz1 is not of type %r)rkr!)rrrrrOrrr"test_object_with_name_type_failuresz>TestValidationErrorMessages.test_object_with_name_type_failurecCs"|jdddid}|j|ddS)NrBrprC)r+rz1 is less than the minimum of 2)rkr!)rrOrrr test_minimumsz(TestValidationErrorMessages.test_minimumcCs"|jdddid}|j|ddS)NrBrar)r+rz"1 is greater than the maximum of 0)rkr!)rrOrrr test_maximumsz(TestValidationErrorMessages.test_maximumcCs<d\}}d||ii}|jddi|}|j|d||fdS)NrXrWZ dependenciesrCz%r is a dependency of %r)rXrW)rkr!)rZdependonrrOrrr5test_dependencies_failure_has_single_element_not_lists zQTestValidationErrorMessages.test_dependencies_failure_has_single_element_not_listcCs$|jdggdd}|jd|dS)NrCF)itemsadditionalItemsz(2 was unexpected))rkassertIn)rrOrrr#test_additionalItems_single_failuresz?TestValidationErrorMessages.test_additionalItems_single_failurecCs(|jdddggdd}|jd|dS)NrBrCrKF)rxryz(1, 2, 3 were unexpected))rkrz)rrOrrr&test_additionalItems_multiple_failuresszBTestValidationErrorMessages.test_additionalItems_multiple_failurescCs2d}ddi}|j|di|}|jd|f|dS)NrWadditionalPropertiesFrCz(%r was unexpected))rkrz)r additionalrrOrrr(test_additionalProperties_single_failureszDTestValidationErrorMessages.test_additionalProperties_single_failurecCsNddi}|jtjddg|}|jtd||jtd||jd|dS)Nr}FrWrXzwere unexpected))rkrfromkeysrzrepr)rrrOrrr+test_additionalProperties_multiple_failuress zGTestValidationErrorMessages.test_additionalProperties_multiple_failurescCsltfd}tjdd}|jd|ddi}|jd||d}|jtd||jtd||jd|dS) N)formatsF)r'thingformatZbla)format_checkerzis not a)rrr*Zchecksrkrzr)rcheckerZcheck_fnrrOrrr#test_invalid_format_default_messages  z?TestValidationErrorMessages.test_invalid_format_default_messagecCsddddiddidd}|jddi|td }|j|d jtdtd td |jdd d|td }|j|djtdtdtd td dS)NrnFr[r\)z^abc$z^def$)r[r}patternPropertieszebra{)r.z,{} does not match any of the regexes: {}, {}z^abc$z^def$i)rfishz.{}, {} do not match any of the regexes: {}, {}r)rkr r!rr)rrrOrrr1test_additionalProperties_false_patternPropertiess  zMTestValidationErrorMessages.test_additionalProperties_false_patternPropertiesN)r6r?r@rkrlrmrorqrsrtrurwr{r|rrrrrrrrreos rec@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)TestValidationErrorDetailscCsd}dddiddigi}t|}t|j|}|jt|d|d}|j|jd|j|j|d|j|j||j|j||j |j |j|j t g|j|j t g|j|jt g|j|jt dg|j|jt dg|j|jt dg|jt|jd t|j\}}|j|jd|j|j|ddd|j|j||j|j|dd|j|j ||j|j t g|j|jt g|j|j t g|j|jt ddg|j|jt ddg|j|jt dddg|j|j|j|jd|j|j|ddd|j|j||j|j|dd|j|j ||j|j t g|j|j t g|j|jt g|j|jt ddg|j|jt ddg|j|jt dddg|jt|jddS) NanyOfrpr[r\rBrrC)r r(r)r!rbrrr+r assertIsNoneparentpathr relative_path absolute_path schema_pathrelative_schema_pathabsolute_schema_pathcontext sorted_errorsassertIsr9)rr+rrrcrIe1e2rrr test_anyOfs\   z%TestValidationErrorDetails.test_anyOfcCsddi}dddiddddgiidgi}t|}t|j|}|jt|d|d }|j|jd|j|j|d|j|j||j|j||j |j |j|j t g|j|j t g|j|jt g|j|jt dg|j|jt dg|j|jt dg|jt|jdt|j\}}|j|jd|j|j|dd d|j|j||j|j|dd |j|j ||j|j t g|j|j t g|j|jt g|j|jt d dg|j|jt d dg|j|jt dd dg|j|j|j|jd|j|jdg|j|jd|j|jddgi|j|j ||j|j t dg|j|j t dg|j|jt dg|j|jt dd ddg|j|jt dd ddg|j|jt ddd ddg|j|jdS) NrWrBr[integerrnrMrC)r[rrr)r r(r)r!rbrrr+rrrrrrrrrrrrrr9)rr+rrrcrIrrrrr test_type sd  z$TestValidationErrorDetails.test_typec Csddgddd}dddid did dd d d gddi}t|}|j|}t|\}}}}|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jtdg|j|jd |j|jd|j|jd|j|jddS)NrCrBrUrV)rWrXrYrZrr[r\rNr]r^r_r`)rarM)rWrXrYrXrYrWrMra) r r)rr!rrrrr) rr+rrrcrre3e4rrrtest_single_nestingjs0 z.TestValidationErrorDetails.test_single_nestingc Csddddgiddg}dddgddd gid d d id diddddd}t|}|j|}t|\}}}}} } |j|jtg|j|jtdg|j|jtddg|j|jtdddg|j| jtdddg|j| jtddg|j|jtdg|j|jtddg|jt|jddddg|jt|jdddddd g|jt| jdddddd g|jt| jddddg|j|jd|j|jd|j|jd|j|jd |j| jd |j| jddS)NrBrCrY)rWrXrZr\rnrMrKrDrequiredTrN)rXrY)r[r)r[rxrrXrWr[rxr) r r)rr!rrrr(r) rr+rrrcrrrrZe5Ze6rrrtest_multiple_nestingsD  z0TestValidationErrorDetails.test_multiple_nestingcCsBdddddgddiddd d iid d d giiddgdd d iid}dddddddiid id i}t|}|j|\}|j|jtdg|j|jtdddg|j\}|j|jtdddg|j|jtdddddddddg |j\}|j|jtdddddg|j|jtdddddddddddddddgdS)Nnoderrnrrchildrenr[r\z^.*$z$refz#/definitions/node)r[r)rrr)r[rrroot)Z definitionsr[rrrEabrrr)r r)r!rrrr)rrr+rrIrrrrrtest_recursivesp  z)TestValidationErrorDetails.test_recursivecCs~ddd}ddddi}t|}|j|}t|\}}|j|jtdg|j|jtdg|j|jd |j|jd dS) NrXrC)rXrWr}rr)r[rprWr[rp)r r)rr!rrr)rr+rrrcrrrrrtest_additionalProperties$s   z4TestValidationErrorDetails.test_additionalPropertiescCsddd}dddiddidi}t|}|j|}t|\}}|j|jtd g|j|jtd g|j|jd|j|jddS) NrBrC)rXrWrr[r\rprrXrW)r r)rr!rrr)rr+rrrcrrrrrtest_patternProperties2s   z1TestValidationErrorDetails.test_patternPropertiescCs~ddg}gdddd}t|}|j|}t|\}}|j|jtdg|j|jtdg|j|jd|j|jd dS) NrWrBrr)r[rp)rxryrr[rp)r r)rr!rrr)rr+rrrcrrrrrtest_additionalItemsEs  z/TestValidationErrorDetails.test_additionalItemscCsdddg}igdddd}t|}|j|}t|\}}|j|jtdg|j|jtdg|j|jd |j|jd dS) NrWrXrBrr)r[rp)rxryrCr[rp)r r)rr!rrr)rr+rrrcrrrrrtest_additionalItems_with_itemsVs   z:TestValidationErrorDetails.test_additionalItems_with_itemsN) r6r?r@rrrrrrrrrrrrrrsBJ"6brc@sdeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)ValidatorTestMixincCs,tj|_i|_tj|_|j|j|_dS)N)rr*r+rresolvervalidator_classr)rrrrr is  zValidatorTestMixin.setUpc CsDtg}tjj|jd|d|j|jj|j|jWdQRXdS)Nr))r') iterrr3rnr assertTrueis_validr+r)rrcrrrtest_valid_instances_are_validos z1ValidatorTestMixin.test_valid_instances_are_validc CsJttjg}tjj|jd|d|j|jj|j|j WdQRXdS)Nr))r') rrr*r3rnrr9rr+r)rrcrrr$test_invalid_instances_are_not_validys z7ValidatorTestMixin.test_invalid_instances_are_not_validcCs0tjtjtj}}}t|||iddS)N)r+r)rr*r)rr+Z my_propertyZmy_valuerrr(test_non_existent_properties_are_ignoredsz;ValidatorTestMixin.test_non_existent_properties_are_ignoredcCs|j|jjtdS)N)ZassertIsInstancerrr )rrrr.test_it_creates_a_ref_resolver_if_not_providedszAValidatorTestMixin.test_it_creates_a_ref_resolver_if_not_providedcCsztdi}dtji}tjj|d>}dddif|_|jt|j||dj dWdQRXWdQRX|j |ddS)Nr2z$refresolveurlr[r)r) r rr*r3rnr'rgrrrr5)rrrrrrr#test_it_delegates_to_a_ref_resolvers   (z6ValidatorTestMixin.test_it_delegates_to_a_ref_resolverc sPGfdddt}|}ddi}jtj||djdWdQRXdS)zc Legacy RefResolvers support only the context manager form of resolution. cseZdZefddZdS)zXValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolver..LegacyRefResolverc3sj|dddiVdS)Nzthe refr[r)r!)thisref)rrr resolvings zbValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolver..LegacyRefResolver.resolvingN)r6r?r@rrr)rrrLegacyRefResolversrz$refzthe ref)rN)rnrgrrr)rrrrr)rr*test_it_delegates_to_a_legacy_ref_resolvers  z=ValidatorTestMixin.test_it_delegates_to_a_legacy_ref_resolvercCs|j|jjdddS)NrWr\)rris_type)rrrr#test_is_type_is_true_for_valid_typesz6ValidatorTestMixin.test_is_type_is_true_for_valid_typecCs|j|jjdddS)NrWrD)r9rr)rrrr&test_is_type_is_false_for_invalid_typesz9ValidatorTestMixin.test_is_type_is_false_for_invalid_typecCs,|j|jjdd|j|jjdddS)NTrnumber)r9rr)rrrr,test_is_type_evades_bool_inheriting_from_intsz?ValidatorTestMixin.test_is_type_evades_bool_inheriting_from_intc Cs*|jt|jjdtWdQRXdS)NrW)rgr rrrn)rrrr.test_is_type_raises_exception_for_unknown_types zAValidatorTestMixin.test_is_type_raises_exception_for_unknown_typeN)r6r?r@r rrrrrrrrrrrrrrrhs   rc@s(eZdZeZddZddZddZdS)TestDraft3ValidatorcCs |j|jjtjddidS)Nr[any)rrrrr*)rrrr!test_is_type_is_true_for_any_typesz5TestDraft3Validator.test_is_type_is_true_for_any_typecCs0|j|jjdd|j|jjdddidS)NTbooleanr[r)rrrr)rrrr6test_is_type_does_not_evade_bool_if_it_is_being_testedszJTestDraft3Validator.test_is_type_does_not_evade_bool_if_it_is_being_testedcCs0ddgi}|j|dtdid}|jd|dS)Nr[)r)rr[r)rrr.rrrtest_non_string_custom_typess z0TestDraft3Validator.test_non_string_custom_typesN)r6r?r@r rrrrrrrrrsrc@seZdZeZdS)TestDraft4ValidatorN)r6r?r@r rrrrrrsrc@seZdZdZdS)TestBuiltinFormatsz The built-in (specification-defined) formats do not raise type errors. If an instance or value is not a string, it should be ignored. N)r6r?r@__doc__rrrrrsrcCs td|itd}|jddS)Nr)rr)r rr)rrvrrrtestsrztest_{0}_ignores_non_stringsc@s4eZdZddZddZddZddZd d Zd S) TestValidatorForcCs4ddi}|jt|tddi}|jt|tdS)Nz$schemaz&http://json-schema.org/draft-03/schemaz'http://json-schema.org/draft-03/schema#)rrr )rrrrr test_draft_3szTestValidatorFor.test_draft_3cCs4ddi}|jt|tddi}|jt|tdS)Nz$schemaz&http://json-schema.org/draft-04/schemaz'http://json-schema.org/draft-04/schema#)rrr )rrrrr test_draft_4szTestValidatorFor.test_draft_4cCs,tddidd}ddi}|jt||dS)Nr1zmeta schema idZ12)rr0z$schema)r rr)rrrrrrtest_custom_validatorsz&TestValidatorFor.test_custom_validatorcCs|jtitdS)N)rrr )rrrr%test_validator_for_jsonschema_defaultsz6TestValidatorFor.test_validator_for_jsonschema_defaultcCs|jtiddddS)N)default)rr)rrrr!test_validator_for_custom_defaultsz2TestValidatorFor.test_validator_for_custom_defaultN)r6r?r@rrrrrrrrrrs rc@s$eZdZddZddZddZdS) TestValidatecCspddi}tjjtd}ti||j|WdQRXddi}tjjtd}ti||j|WdQRXdS)Nz$schemaz'http://json-schema.org/draft-03/schema# check_schemaz&http://json-schema.org/draft-03/schema)rr3rnr rr5)rr chk_schemarrrtest_draft3_validator_is_chosens  z,TestValidate.test_draft3_validator_is_chosenc Cs:ddi}tjjtd}ti||j|WdQRXdS)Nz$schemaz'http://json-schema.org/draft-04/schema#r)rr3rnr rr5)rrrrrrtest_draft4_validator_is_chosens z,TestValidate.test_draft4_validator_is_chosenc Cs2tjjtd}tii|jiWdQRXdS)Nr)rr3rnr rr5)rrrrr$test_draft4_validator_is_the_default s z1TestValidate.test_draft4_validator_is_the_defaultN)r6r?r@rrrrrrrrs rc@seZdZdZdZddiZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZddZddZdd Zd!S)"TestRefResolverr2z foo://storedZstoredrcCs,i|_|j|ji|_t|j|j|j|_dS)N)referrer stored_uri stored_schemastorer base_urir)rrrrr szTestRefResolver.setUpcCs\tjd}tjj|jd,}|jj|}|j|tjWdQRXWdQRX|j|j dS)Nr1Zresolve_remote) r r#rr3rnrrr!r9r:)rrremoteresolvedrrr6test_it_does_not_retrieve_schema_urls_from_the_networks  "zFTestRefResolver.test_it_does_not_retrieve_schema_urls_from_the_networkc CsFd}dti|jd<|jj|}|j||jddWdQRXdS)Nz#/properties/foorWr)rnrrrr!)rrrrrrtest_it_resolves_local_refs$sz+TestRefResolver.test_it_resolves_local_refscCshdddid}tj|}|jd}|j||dWdQRX|jd}|j||dWdQRXdS)Nzhttp://bar/schema#rWrX)r1rEz#/arEzhttp://bar/schema#/a)r from_schemarr!)rrrrrrr#test_it_resolves_local_refs_with_id*s    z3TestRefResolver.test_it_resolves_local_refs_with_idcCs`|jj|j}|j||jWdQRXddi|jjd<|jjd}|j|dWdQRXdS)NrWrZ cached_refzcached_ref#/foo)rrrrrrr!)rrrrrtest_it_retrieves_stored_refs2s z-TestRefResolver.test_it_retrieves_stored_refscCsbd}ddi}tjd6}||jjj_|jj|}|j|dWdQRXWdQRX|jjddS)Nzhttp://bar#bazrYrzjsonschema.validators.requestsz http://bar) rr3getr'jsonrrr!r5)rrrrequestsrrrr,test_it_retrieves_unstored_refs_via_requests:s   zTestRefResolver.test_it_can_construct_a_base_uri_from_a_schemacCsri}tj|}|j|jd|j|jd|jd}|j||WdQRX|jd}|j||WdQRXdS)Nr2r)r rr!rrr)rrrrrrr9test_it_can_construct_a_base_uri_from_a_schema_without_id^s   zITestRefResolver.test_it_can_construct_a_base_uri_from_a_schema_without_idc CsZddi}d}tj|d}tdid|id}|j|}|j||WdQRX|j|dS)NrWrXz foo://bar)r'r2)handlers)rr*r rr!r5)rrr foo_handlerrrrrrtest_custom_uri_scheme_handlershs  z/TestRefResolver.test_custom_uri_scheme_handlerscCsZd}tj}tdidd|id}|j|WdQRX|j|WdQRX|j|dS)Nz foo://barr2TrW) cache_remoter)rr*r rr5)rrrrrrrtest_cache_remote_onqs    z$TestRefResolver.test_cache_remote_onc CsHd}tj}tdidd|id}|j|WdQRX|j|jddS)Nz foo://barr2FrW)rrrB)rr*r rr!Z call_count)rrrrrrrtest_cache_remote_off}s  z%TestRefResolver.test_cache_remote_offcCshd}tjtdd}tdid|id}|jt}|j|WdQRXWdQRX|jt|j ddS)Nz foo://barzOh no! What's this?)r4r2rW)r) rr* ValueErrorr rgrrr!strrh)rrrrerrrrr3test_if_you_give_it_junk_you_get_a_resolution_errors  zCTestRefResolver.test_if_you_give_it_junk_you_get_a_resolution_errorc CsFtdi}|j|jt}|jWdQRX|jdt|jdS)Nr2zFailed to pop the scope)r Z pop_scopergrrzrrh)rrexcrrr.test_helpful_error_message_on_failed_pop_scopes   z>TestRefResolver.test_helpful_error_message_on_failed_pop_scopeN)r6r?r@rrrr rrrrrrrrrrrrrrrrrrs"       rc@seZdZdZddZdS)UniqueTupleItemsMixinz A tuple instance properly formats validation errors for uniqueItems. See https://github.com/Julian/jsonschema/pull/224 c CsN|jddidtfid}|jt}|jdWdQRX|jdt|jdS)NZ uniqueItemsTrD)rrrBz(1, 1) has non-unique elements)rBrB)rtuplergrrrzrrh)rrrIrrr)test_it_properly_formats_an_error_messages  z?UniqueTupleItemsMixin.test_it_properly_formats_an_error_messageN)r6r?r@rr rrrrrsrc@seZdZeZdS)TestDraft4UniqueTupleItemsN)r6r?r@r rrrrrr sr c@seZdZeZdS)TestDraft3UniqueTupleItemsN)r6r?r@r rrrrrr sr cCsdd}t||dS)NcSs dd|jDdd|jDfS)NcSsg|] }t|qSr)r)rPrIrrr sz.sorted_errors..key..cSsg|] }t|qSr)r)rPrIrrrr s)rr)r,rrrkeyszsorted_errors..key)r )rR)rcr rrrrsr), collectionsr contextlibrrZ jsonschemarrZjsonschema.tests.compatrrZjsonschema.validatorsrr r r r r rrrZTestCaserrArerrnrrrrZcheckersrrrrr6setattrrrrrr r rrrrrs<  ,@"lO