[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.135.201.22: ~ $
U

!�`��@s�ddlZddlZddlmZmZmZddlmZddlm	Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)%�N)�	Validator�errors�SchemaError)�UnvalidatedSchema��assert_schema_errorc	Cs2t�}tjttjd��|idd�W5QRXdS)N��match��schema)r�pytest�raisesrrZSCHEMA_ERROR_MISSING)�	validator�r�K/opt/alt/python38/lib/python3.8/site-packages/cerberus/tests/test_schema.py�test_empty_schemasrc	Cs4d}tj�|�}tjt|d��||_W5QRXdS)Nz!this string should really be dictr)rZSCHEMA_ERROR_DEFINITION_TYPE�formatrr
rr)rr�msgrrr�test_bad_schema_typesrc	Cs8d}|ddddiiii}t�t��||_W5QRXdS)N�foor�bar�typeZstrong)rr
rr)r�fieldrrrr�test_bad_schema_type_fieldsrc	Cs6d}tjtt�|�d��dddii|_W5QRXdS)Nz({'foo': [{'unknown': ['unknown rule']}]}rr�unknownZrule)rr
r�re�escaper�rrrrr�test_unknown_rule src	CsFtdddgigi�}tjtt�|�d��dddii|_W5QRXdS)NrrzUnsupported types: unknownrr��strrr
rrrrrrrr�test_unknown_type&sr!c	Cs@d}t|dgi�}tjtt�|�d��|di|_W5QRXdS)N�namezmust be of dict typerzthis should really be a dictr)rrrrrr�test_bad_schema_definition,sr#cCsddddiii}ti|�dS)Nr�anyofr�stringrr
rrr�test_bad_of_rules3sr&cCs$ddddd�igii}ti|�dS)Nrr$�coercecSs|S�Nr��xrrr�<lambda>9�zBtest_normalization_rules_are_invalid_in_of_rules.<locals>.<lambda>rr
rrr�0test_normalization_rules_are_invalid_in_of_rules8sr-cCs\ddddddiigigd�i}tddi|�ddddddiigigd	�i}tddi|�dS)
N�doc�dictrZparamrZnumber)rr$zthis is my document)rZallofrr
rrr� test_anyof_allof_schema_validate=s��r0cCs&tdddii�}t|j�dks"t�dS)Nrrr%z{'foo': {'type': 'string'}})r�reprr�AssertionError)�vrrr�	test_reprKsr4cCs�tddtii�}t|j�}tdddii�}|d7}t|j�|ksDt�tddtii�}t|j�|ksft�d}||ks~td|��dS)NZfoozifixr'rZinteger��aThere's an unexpected high amount (%s) of cached valid definition schemas. Unless you added further tests, there are good chances that something is wrong. If you added tests with new schemas, you can try to adjust the variable `max_cache_size` according to the added schemas.)r�int�lenZ_valid_schemasr2)r3Z
cache_sizeZmax_cache_sizerrr�test_validated_schema_cachePs

��r9cCsFdddddgiii}t|�}|jdddddiddigiksBt�dS)NZdetroitrZanyof_regexz^AladdinzSane$r$Zregex�rrr2)rr3rrr�test_expansion_in_nested_schemafs�r;cCst�}|��}||kst�dSr()r�copyr2)rZschema_copyrrr�%test_unvalidated_schema_can_be_copiednsr=cCs�dd�}ddddiddid�d�dd	iid
|idiigd�d
�}t|�}|jddddiddid�d�ddiid|idiigd�d
�ks�t�dS)NcSsdSr(r�r�value�errorrrr�
check_withvsz=test_deprecated_rule_names_in_valueschema.<locals>.check_withr/rr%)r�	keyschema�valueschema)rrC�listrBrrC)r�items)Zfield_1Zfield_2)r�	keysrules�valuesrules)rrGrFrArGr:)rArrrrr�)test_deprecated_rule_names_in_valueschemaus:��	�����	���rHcCsNdd�}dd�}dd||gii}t|�}|jddd|id|igiiksJt�dS)	NcSsdSr(rr>rrrr�sz"test_anyof_check_with.<locals>.foocSsdSr(rr>rrrr�sz"test_anyof_check_with.<locals>.barrZanyof_check_withr$rAr:)rrrrrrr�test_anyof_check_with�s�rIcCstddd�dd�id�dS)NrcSs|Sr(rr)rrrr+�r,z3test_rulename_space_is_normalized.<locals>.<lambda>r%)zdefault setterrr
)rrrrr�!test_rulename_space_is_normalized�srJ)rrZcerberusrrrZcerberus.schemarZcerberus.testsrrrrrr!r#r&r-r0r4r9r;r=rHrIrJrrrr�<module>s(-

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 3.33 KB 0644
__init__.cpython-38.pyc File 3.9 KB 0644
conftest.cpython-38.opt-1.pyc File 1.93 KB 0644
conftest.cpython-38.pyc File 1.93 KB 0644
test_assorted.cpython-38.opt-1.pyc File 3.75 KB 0644
test_assorted.cpython-38.pyc File 4.01 KB 0644
test_customization.cpython-38.opt-1.pyc File 4.37 KB 0644
test_customization.cpython-38.pyc File 4.56 KB 0644
test_errors.cpython-38.opt-1.pyc File 5.53 KB 0644
test_errors.cpython-38.pyc File 8.28 KB 0644
test_legacy.cpython-38.opt-1.pyc File 168 B 0644
test_legacy.cpython-38.pyc File 168 B 0644
test_normalization.cpython-38.opt-1.pyc File 14.6 KB 0644
test_normalization.cpython-38.pyc File 15.16 KB 0644
test_registries.cpython-38.opt-1.pyc File 2.98 KB 0644
test_registries.cpython-38.pyc File 3.05 KB 0644
test_schema.cpython-38.opt-1.pyc File 4.76 KB 0644
test_schema.cpython-38.pyc File 5.46 KB 0644
test_utils.cpython-38.opt-1.pyc File 437 B 0644
test_utils.cpython-38.pyc File 485 B 0644
test_validation.cpython-38.opt-1.pyc File 40.9 KB 0644
test_validation.cpython-38.pyc File 42.88 KB 0644