Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_suite.cpython-313.pyc84 linesDownload Raw Back to __pycache__
1�

2��j� ���SrSSKJr SSKJr SSKJr SSKJr SSK	J3r4Jr SSKrSSK
r
SSKrSSKrSSKrSSKJrJr SS	KJr SSKr\5(aSS6KJrJrJr SSKJr SSKrSSKJr SSKrS
r \RB"S5r"Sr#\"SS55r$\"SS55r%\"SS55r&SSjr'\"SS9"SS55r(Sr)g)z=7Python representations of the JSON Schema Test Suite tests.8�)�annotations)�suppress)�partial)�Path)�
TYPE_CHECKING�AnyN)�field�frozen)�Registry)�Iterable�Mapping�Sequence)�Schema)�_VALIDATORSzhttp://localhost:1234z[\W\- ]+c��[RRS5nUb[U5$[[R95RRS-nUR5(d[S5eU$)N�JSON_SCHEMA_TEST_SUITE�jsonz�Can't find the JSON-Schema-Test-Suite directory. Set the 'JSON_SCHEMA_TEST_SUITE' environment variable or run the tests from alongside a checkout of the suite.)	�os�environ�getr�10jsonschema�__file__�parent�is_dir�11ValueError)�roots �]D:\code\apps\devtools\python\user_packages\Python313\site-packages\jsonschema/tests/_suite.py�_find_suiter"sj��
�:�:�>�>�2�3�D����D�z���12�#�#�$�+�+�2�2�V�;�D��;�;�=�=�� �13�	14��K�c�@�\rSrSr%\"\S9rS\S'S	SjrS15Sjr	Sr16g)�Suite�4)�factoryr�_rootc�z�[R"5H"up#URUS9RUUS9 M$ g)N)�name)�runner�	Validator)r�items�version�	benchmark)�selfr'r&r(s    rr+�Suite.benchmark:s;��*�0�0�2�O�D��L�L�d�L�#�-�-��#�
.�
� 3rc��[UnURUR5n[RRU5n[
5R[URS-XS9US9n[UURS-U-US9$)N�remotes)rr&�uri)�default_specification�tests)r&�pathr/)r�ID_OF�META_SCHEMA�referencingr�specification_withr�
with_contents�17remotes_inr$�Version)r,r&r(r0�
specification�registrys      rr*�
Suite.versionAs�����%�	��?�?�9�#8�#8�9��#�.�.�A�A�#�F�
��:�+�+��D�J�J��2��G�"/�,�18�������g�%��,��19�	20r�N�r'z
pyperf.Runner)�returnr:)�__name__�21__module__�__qualname__�__firstlineno__r	rr$�__annotations__r+r*�__static_attributes__r>rrr!r!4s����,�E�4�,��
22rr!c�h�\rSrSr%S\S'S\S'S\S'SrSS	jrSS23jrSSjrSr	SS
jr24Srg)r:�Qr�_path�%referencing.jsonschema.SchemaRegistry�_remotes�strr&c�V�UR5HnUR"S0UD6 M g�Nr>)�casesr+)r,�kwargs�cases   rr+�Version.benchmarkYs!���J�J�L�D��N�N�$�V�$�!rc�R�URURRS5S9$)N�*.json��paths��	_cases_inrI�glob�r,s rrO�
Version.cases]s ���~�~�D�J�J�O�O�H�$=�~�>�>rc�R�URURRS5S9$)Nzoptional/format/*.jsonrUrWrZs r�format_cases�Version.format_cases`s!���~�~�D�J�J�O�O�4L�$M�~�N�Nrc�H�URURS-US3-/S9$)N�optionalz.jsonrU)rXrI)r,r&s  r�optional_cases_of�Version.optional_cases_ofcs*���~�~�T�Z�Z�*�%<�$��u�~�%M�$N�~�O�Orc�^�TRSSURR5RSS5-5nU4SjU5Vs0sHnURU_M nn[U[R4U5n[[5 [5UlSSS5 U$s snf!,(df   U$=f)Nr&�Test�-�c3�># �UH5nUH+nURHnUR"S0TD6v� M M- M7 g7frN)r2�to_unittest_method)�.0�grouprQ�testrPs    �r�	<genexpr>�/Version.to_unittest_testcase.<locals>.<genexpr>jsF�����#�E�!�D� �J�J�D��'�'�1�&�1�'�2�!�2�#�s�=A)�popr&�title�replacerA�type�unittest�TestCaser�	Exception�)_someone_save_us_the_module_of_the_callerrB)r,�groupsrPr&�method�methods�clss  `    r�to_unittest_testcase�Version.to_unittest_testcasefs�����z�z�&�&�4�9�9�?�?�+<�+D�+D�S�"�+M�"M�N���#��25���
�O�O�V�#��	�26��4�(�+�+�-�w�7��27�i�
 �F�H�C�N�!��28��#29�!�
 ��30�s�
B+�B0�031B?c	#��# �UHYn[R"URSS95H/n[R	UUUR32URS9v� M1 M[ g7f)Nzutf-8)�encoding)r*�subjectr/)r�loads�	read_text�_Case�	from_dict�stemrK)r,rVr3rQs    rrX�Version._cases_in{sX����D��33�34�4�>�>�7�>�#C�D���o�o�� � �I�I� �M�M�	&���E��s�A!A#r>N)r@�Iterable[_Case])r&rLr@r�)rVzIterable[Path]r@r�)rArBrCrDrEr+rOr]rarzrXrFr>rrr:r:Qs4���K�3�3�35
�I�%�?�O�P��*rr:c�~�\rSrSr%S\S'S\S'S\S'S\S'S	\S36'SrS\S
'SrS\S'\S5rSSjr	Sr37g)r��r:r*rLr~�description�Mapping[str, Any] | bool�schemazlist[_Test]r2N�38str | None�commentr>zSequence[dict[str, str]]r;c��URU5 URS5Vs/sH n[SUSUSUSUSUS.UD6PM" nnU"SSU0UD6$s snf)Nr2r*r~r�r�)r*r~�case_descriptionr�r/r>)�updatern�_Test)ry�datar/rPrkr2s      rr��_Case.from_dict�s������F���(�(�7�+�	39�,�$�
�
��Y���Y��!%�m�!4��H�~��
��

�,�	�	40��'��'�$�'�'��	41s�'Ac	��URH3nURUR[UR40UD65 M5 g�N)r2�42bench_func�fully_qualified_namer�validate_ignoring_errors)r,r'rPrks    rr+�_Case.benchmark�s:���J�J�D�����)�)���5�5�@��@�
�rr?)rArBrCrDrEr�r;�classmethodr�r+rFr>rrr�r��sM����
�L���$�$����G�Z��.0�M�+�0��(��(�rr�c#�# �URS5H�n[R"UR55n[	URU55R
SS5nUS;aURS:Xd2SU;a.URS5(aURU5(dM�[SU3U4v� M� g7f)NrT�\�/>�draft3�draft4�treez$schema�draft)43�rglobrrr�rL�relative_torpr��44startswith�MAGIC_REMOTE_URL)rr&r0�eachr��relatives      rr9r9�s�����45�46�8�$�����D�N�N�,�-���t�'�'��-�.�6�6�t�S�A���,�,��I�I��'���'��'�'��0�0� �+�+�D�1�1�
�!�"�!�H�:�.��6�6�#%�s�CCF)�reprc��\rSrSr%S\S'S\S'S\S'S\S'S\S	'S47\S'S\S
'S\S'SrS\S'Sr\S5rS4Sjr	Sr48SrSrg)r���r:r*rLr~r�r�rr�r�r��bool�validrJrKNr�r�c�"�SURS3$)Nz<Test �>)r�rZs r�__repr__�_Test.__repr__�s����1�1�2�!�4�4rc��SRURRURURUR49/5$)Nz > )�joinr*r&r~r�r�rZs rr��_Test.fully_qualified_name�s>���z�z����!�!�����%�%�� � �	
�50�	51rc��gr�r>)rks r�<lambda>�_Test.<lambda>�s��4rc	�<^^�TR(aUU4SjnOUU4SjnSRS[RSTR5[RSTR525[RSTR5/5UlU"T5nUb$[RRSS5S:waU$[RRSS5S:wa[R"U5$[R"U5"U5$)Nc�*>�TR"S0TD6 grN)�validate��thisrPr,s ��r�fn�$_Test.to_unittest_method.<locals>.fn�s����
�
�'��'rc�>�UR[R5 TR"S0TD6 SSS5 g!,(df   g=frN)�assertRaisesr�ValidationErrorr�r�s ��rr�r��s3����&�&�z�'A�'A�B��M�M�+�F�+�C�B�B�s	�=�53A�_rk�JSON_SCHEMA_DEBUG�0�JSON_SCHEMA_EXPECTED_FAILURES)r�r��_DELIMITERS�subr~r�r�rArrrrr�expectedFailure�skip)r,r�rPr��reasons` `  rrh�_Test.to_unittest_method�s�����:�:�
(�
,��h�h������T�\�\�2�����T�%:�%:�;�����T�%5�%5�6�	
�54����d����>�R�Z�Z�^�^�,?��E��L��I�
�Z�Z�^�^�;�S�
A�S�
H��+�+�B�/�/��=�=��(��,�,rc��URUR5 U"SURURS.UD6n[RRSS5S:wa55[
5 URURS9 g)N)r�r<r�r�)�instancer>)	�check_schemar�rKrrr�56breakpointr�r�)r,r(rP�	validators    rr��_Test.validateso�����t�{�{�+��57��;�;��]�]�58��59�	�60�:�:�>�>�-�s�3�s�:��L����D�I�I��.rc��[[R5 URUS9 SSS5 g!,(df   g=f)N)r()rrr�r�)r,r(s  rr��_Test.validate_ignoring_errorss*��
�j�0�0�
1��M�M�I�M�.�2�
1�
1�s	�3�61Ar>)
rArBrCrDrEr�r��propertyr�rhr�r�rFr>rrr�r��sh����
�L�����62
�I�$�$��K�3�3��G�Z��5��63��64�'8�-�2	/�/rr�c�H�[R"S5RS$)ak65The FQON of the module 2nd stack frames up from here.66 67This is intended to allow us to dynamically return test case classes that68are indistinguishable from being defined in the module that wants them.69 70Otherwise, trial will mis-print the FQON, and copy pasting it won't re-run71the class that really is running.72 73Save us all, this is all so so so so so terrible.74�rA)�sys�	_getframe�	f_globalsr>rrrurus���=�=���%�%�j�1�1r)rrr&rLr0rLr@zIterable[tuple[str, Schema]])*�__doc__�75__future__r�76contextlibr�	functoolsr�pathlibr�typingrrrr�rer�rr�attrsr	r77r6r�referencing.jsonschema�collections.abcrr
rr�pyperf�jsonschema.validatorsrrr��compiler�rr!r:r�r9r�rur>rr�<module>r�s����#����%��	�	�78��� ���;�;�-��-��*���j�j��%���$�79�80��81�8�1�1��1�h�����D7�82�7�83
�7�84
�7�"�	7�<�U��E/�E/��E/�P
2r
codekingpro/portable-devtools · Team Ai