HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/test/__pycache__/test_formmethod.cpython-310.pyc
o

�by�@s2dZddlmZddlmZGdd�dej�ZdS)z#
Test cases for formmethod module.
�)�
formmethod)�unittestc@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
ArgumentTestsc	OsV|dg|�Ri|��}|D]
\}}|�|�|�|�q
|D]}|�tj|j|�qdS)N�name)�assertEqual�coerce�assertRaisesr�
InputError)	�self�argKlass�	testPairs�	badValues�args�kwargs�arg�val�result�r�>/usr/lib/python3/dist-packages/twisted/test/test_formmethod.py�argTests�zArgumentTests.argTestcCst�d�}|�t|jd�dS)zG
        Test that corce correctly raises NotImplementedError.
        r�N)r�Argumentr�NotImplementedErrorr)r
rrrr�
test_arguments
zArgumentTests.test_argumentcCsb|�tjgd�d�|jtjddgddd�|jtjddgd	d
d�|jtjddgd
dd
d�dS)N)��ar)��1�rrr��abr )�abcr!)�2r�)�minr)�223213�345x�)�max)�addr))r%�x�r$r()rr�String�r
rrr�
testStrings��
�zArgumentTests.testStringcC�0|�tjgd�d�|jtjddgddd�dS)N)��3r'�z-2����rN)�q�2.3r0r2)r5r6rr��	allowNone)rr�Integerr-rrr�testInt,s�
�zArgumentTests.testIntcCr/)N)�r1g@�z-2.3gffffff�r4)r5�2.3zr;r<)r5r=rrr7)rr�Floatr-rrr�	testFloat4s�
�zArgumentTests.testFloatcCs$ddg}|jtjddgd|d�dS)N�r�applezan apple��b�banana�ook)rrA)rCrD)�cr)�choices)rr�Choice)r
rGrrr�
testChoice?s
�zArgumentTests.testChoicecCsBddg}|jtjdgdgfddgddgfgddgdgf|d	�dS)
Nr@rBrrArCrDrF�fdfs)�flags)rr�Flags)r
rKrrr�	testFlagsHs
�zArgumentTests.testFlagscCsgd�}|�tj|d�dS)N))�yesr)rr)�Falser)�norr)rr�Boolean)r
�testsrrr�testBooleanQszArgumentTests.testBooleancCsPtjddd�}|�|�d�d�|�tj|jd�t�d�}|�|�d��dS)z>
        Test the correctness of the coerce function.
        rrr7�	somethingN)r�Filerrrr	�assertIsNone)r
r�arg2rrr�	test_fileUs

zArgumentTests.test_filecCs,dddd���}gd�}|�tj||�dS)N)i���)i�r#�))�2002�12�21)�1996r"�29)rrr))r\r"r`)�xxr"r1)r\�13r)�1999r]�32)r\r)r\r"r1�4)�itemsrr�Date�r
�	goodTests�badTestsrrr�testDate_s��zArgumentTests.testDatecCs0dddd���}gd�}|�tj||dd�dS)NrrYr')�0r]r1)z-1r*rbz-2000z3.4)rfrr�IntegerRangerhrrr�testRangedIntegeroszArgumentTests.testRangedIntegercCs0ddd���}gd�}|jtj||ddd�dS)N�foor ))roror))r r)�12345rprr)r)rrrr#�r+)rfrr�VerifiedPasswordrhrrr�testVerifiedPasswordtsz"ArgumentTests.testVerifiedPasswordN)�__name__�
__module__�__qualname__rrr.r:r?rIrMrSrXrkrnrsrrrrr
s		
rN)�__doc__�twisted.pythonr�
twisted.trialr�TestCaserrrrr�<module>s