404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.128.206.181: ~ $
3

�}:a� �@s�dZddlZddlZddlmZGdd�dej�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�Z	Gdd
�d
ej�Z
edkr�ej�dS)zTests for josepy.util.�N)�	test_utilc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�ComparableX509Testz%Tests for josepy.util.ComparableX509.cCsLtjd�|_tjd�|_tjd�|_tjd�|_tjd�|_tjd�|_dS)Nzcsr.pemzcsr-san.pemzcert.pemzcert-san.pem)	rZload_comparable_csr�req1�req2�	req_otherZload_comparable_cert�cert1�cert2�
cert_other)�self�r�/usr/lib/python3.6/util_test.py�setUpszComparableX509Test.setUpcCs|j|jj�d�dS)NT)�assertIsrZhas_expired)r
rrr�test_getattr_proxysz%ComparableX509Test.test_getattr_proxycCs$|j|j|j�|j|j|j�dS)N)�assertEqualrrrr)r
rrr�test_eqszComparableX509Test.test_eqcCs$|j|j|j�|j|j|j�dS)N)�assertNotEqualrrrr	)r
rrr�test_neszComparableX509Test.test_necCs |j|jd�|j|jd�dS)N�)rrr)r
rrr�test_ne_wrong_types!sz&ComparableX509Test.test_ne_wrong_typescCsd|jt|j�t|j��|jt|j�t|j��|jt|j�t|j��|jt|j�t|j��dS)N)	r�hashrrrrrrr	)r
rrr�	test_hash%szComparableX509Test.test_hashcCs2x,|j|jfD]}|jt|�dj|j��qWdS)Nz<ComparableX509({0!r})>)rrr�repr�format�wrapped)r
Zx509rrr�	test_repr,s
zComparableX509Test.test_reprN)�__name__�
__module__�__qualname__�__doc__r
rrrrrrrrrrr	s
rc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�ComparableRSAKeyTestz'Tests for josepy.util.ComparableRSAKey.cCs(tjd�|_tjd�|_tjd�|_dS)Nzrsa256_key.pemzrsa512_key.pem)rZload_rsa_private_key�key�key_same�key2)r
rrrr
5szComparableRSAKeyTest.setUpcCs|jd|jj�dS)N�)rr!�key_size)r
rrrr;sz'ComparableRSAKeyTest.test_getattr_proxycCs|j|j|j�dS)N)rr!r")r
rrrr>szComparableRSAKeyTest.test_eqcCs|j|j|j�dS)N)rr!r#)r
rrrrAszComparableRSAKeyTest.test_necCs|j|jd�dS)Nr)rr!)r
rrr�test_ne_different_typesDsz,ComparableRSAKeyTest.test_ne_different_typescCs|j|j|jj�dS)N)rr!r"�_wrapped)r
rrr�test_ne_not_wrappedGsz(ComparableRSAKeyTest.test_ne_not_wrappedcCs$ddlm}|j|d�|d��dS)Nr)�ComparableRSAKeyr)�josepy.utilr)r)r
r)rrr�test_ne_no_serializationKsz-ComparableRSAKeyTest.test_ne_no_serializationcCsF|jt|j�t�|jt|j�t|j��|jt|j�t|j��dS)N)�assertIsInstancerr!�intrr"rr#)r
rrrrOszComparableRSAKeyTest.test_hashcCs|jt|j�jd�d�dS)Nz'<ComparableRSAKey(<cryptography.hazmat.T)rrr!�
startswith)r
rrrrTszComparableRSAKeyTest.test_reprcCs"ddlm}|j|jj�|�dS)Nr)r))r*r)r,r!�
public_key)r
r)rrr�test_public_keyXsz$ComparableRSAKeyTest.test_public_keyN)rrrrr
rrrr&r(r+rrr0rrrrr 2sr c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�ComparableECKeyTestz&Tests for josepy.util.ComparableECKey.cCs4tjd�|_tjd�|_tjd�|_tjd�|_dS)Nzec_p256_key.pemzec_p384_key.pemzec_p521_key.pem)rZload_ec_private_key�p256_key�
p256_key_same�p384_key�p521_key)r
rrrr
`szComparableECKeyTest.setUpcCs|jd|jj�dS)Nr$)rr2r%)r
rrrrgsz&ComparableECKeyTest.test_getattr_proxycCs|j|j|j�dS)N)rr2r3)r
rrrrjszComparableECKeyTest.test_eqcCs$|j|j|j�|j|j|j�dS)N)rr2r4r5)r
rrrrmszComparableECKeyTest.test_necCs|j|jd�dS)Nr)rr2)r
rrrr&qsz+ComparableECKeyTest.test_ne_different_typescCs|j|j|jj�dS)N)rr2r3r')r
rrrr(tsz'ComparableECKeyTest.test_ne_not_wrappedcCs$ddlm}|j|d�|d��dS)Nr)�ComparableECKeyr)r*r6r)r
r6rrrr+xsz,ComparableECKeyTest.test_ne_no_serializationcCs^|jt|j�t�|jt|j�t|j��|jt|j�t|j��|jt|j�t|j��dS)N)	r,rr2r-rr3rr4r5)r
rrrr|szComparableECKeyTest.test_hashcCs|jt|j�jd�d�dS)Nz&<ComparableECKey(<cryptography.hazmat.T)rrr2r.)r
rrrr�szComparableECKeyTest.test_reprcCs"ddlm}|j|jj�|�dS)Nr)r6)r*r6r,r2r/)r
r6rrrr0�sz#ComparableECKeyTest.test_public_keyN)rrrrr
rrrr&r(r+rrr0rrrrr1]sr1c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�ImmutableMapTestz#Tests for josepy.util.ImmutableMap.cCs|ddlm}Gdd�d|�}Gdd�d|�}||_||_|jddd	�|_|jddd
�|_|jddd	�|_|jddd	�|_dS)
Nr)�ImmutableMapc@seZdZdZdS)z!ImmutableMapTest.setUp.<locals>.A�x�yN)r9r:)rrr�	__slots__rrrr�A�sr<c@seZdZdZdS)z!ImmutableMapTest.setUp.<locals>.Br9r:N)r9r:)rrrr;rrrr�B�sr=��)r9r:)r:r9��)r*r8r<r=�a1�a1_swap�a2�b)r
r8r<r=rrrr
�szImmutableMapTest.setUpcCs>|j|jddd�|jjdd��|j|j|jjddd��dS)Nr?)r9r:)r9r@rA)rr<rB�updaterD)r
rrr�test_update�s zImmutableMapTest.test_updatecCs|jt|jjd�dS)N�z)�assertRaises�KeyErrorrB�__getitem__)r
rrr�&test_get_missing_item_raises_key_error�sz7ImmutableMapTest.test_get_missing_item_raises_key_errorcCs|j|j|j�dS)N)rrBrC)r
rrr�"test_order_of_args_does_not_matter�sz3ImmutableMapTest.test_order_of_args_does_not_mattercCs(|jt|jdd�|jt|jdd�dS)Nr>)r9r?)r:)rI�	TypeErrorr<)r
rrr�test_type_error_on_missing�sz+ImmutableMapTest.test_type_error_on_missingcCs.|jt|jddd�|jt|jdddd�dS)Nr>r?)r9rHr@)r9r:rH)rIrNr<)r
rrr�test_type_error_on_unrecognized�sz0ImmutableMapTest.test_type_error_on_unrecognizedcCsD|jd|jj�|jd|jj�|jd|jj�|jd|jj�dS)Nr>r?)rrBr9r:rC)r
rrr�
test_get_attr�szImmutableMapTest.test_get_attrcCs|jttj|jjd�d�dS)Nr9�
)rI�AttributeError�	functools�partialrB�__setattr__)r
rrr�$test_set_attr_raises_attribute_error�sz5ImmutableMapTest.test_set_attr_raises_attribute_errorcCs4|j|j|j�|j|j|j�|j|j|j�dS)N)rrBrDr)r
rrr�
test_equal�szImmutableMapTest.test_equalcCs|jtd�t|j��dS)Nr>r?)r>r?)rrrB)r
rrrr�szImmutableMapTest.test_hashcCs|jt|jdid�j�dS)Nr>)r9r:)rIrNr<�__hash__)r
rrr�test_unhashable�sz ImmutableMapTest.test_unhashablecCsT|jdt|j��|jdt|j��|jdt|j��|jdt|jddd���dS)NzA(x=1, y=2)zB(x=1, y=2)zB(x='foo', y='bar')ZfooZbar)r9r:)rrrBrCrEr=)r
rrrr�szImmutableMapTest.test_reprN)rrrrr
rGrLrMrOrPrQrWrXrrZrrrrrr7�sr7c@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�frozendictTestz!Tests for josepy.util.frozendict.cCsddlm}|ddd�|_dS)Nr)�
frozendictr>�2)r9r:)r*r\�fdict)r
r\rrrr
�szfrozendictTest.setUpcCs(ddlm}|j|j|ddd���dS)Nr)r\r>r])r9r:)r*r\rr^)r
r\rrr�test_init_dict�szfrozendictTest.test_init_dictcCs&ddlm}|jt|ddij��dS)Nr)r\�arE)r*r\rIrN�items)r
r\rrr�!test_init_other_raises_type_error�sz0frozendictTest.test_init_other_raises_type_errorcCs|jdt|j��dS)Nr?)r�lenr^)r
rrr�test_len�szfrozendictTest.test_lencCs|jt|j�t�dS)N)r,rr^r-)r
rrrr�szfrozendictTest.test_hashcCs$|jd|jj�|jd|jj�dS)Nr>r])rr^r9r:)r
rrrr�sz!frozendictTest.test_getattr_proxycCs|jt|jjd�dS)NrH)rIrSr^�__getattr__)r
rrr�#test_getattr_raises_attribute_error�sz2frozendictTest.test_getattr_raises_attribute_errorcCs|jt|jjdd�dS)NrHr@)rIrSr^rV)r
rrr�test_setattr_immutable�sz%frozendictTest.test_setattr_immutablecCs|jdt|j��dS)Nzfrozendict(x=1, y='2'))rrr^)r
rrrr�szfrozendictTest.test_reprN)
rrrrr
r_rbrdrrrfrgrrrrrr[�sr[�__main__)
rrTZunittestZjosepyrZTestCaserr r1r7r[r�mainrrrr�<module>s)+.D$

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 1.95 KB 0644
__init__.cpython-36.pyc File 1.95 KB 0644
b64.cpython-36.opt-1.pyc File 1.56 KB 0644
b64.cpython-36.pyc File 1.56 KB 0644
b64_test.cpython-36.opt-1.pyc File 3.47 KB 0644
b64_test.cpython-36.pyc File 3.47 KB 0644
errors.cpython-36.opt-1.pyc File 1.55 KB 0644
errors.cpython-36.pyc File 1.55 KB 0644
errors_test.cpython-36.opt-1.pyc File 854 B 0644
errors_test.cpython-36.pyc File 854 B 0644
interfaces.cpython-36.opt-1.pyc File 7.93 KB 0644
interfaces.cpython-36.pyc File 7.93 KB 0644
interfaces_test.cpython-36.opt-1.pyc File 5.38 KB 0644
interfaces_test.cpython-36.pyc File 5.38 KB 0644
json_util.cpython-36.opt-1.pyc File 14.93 KB 0644
json_util.cpython-36.pyc File 14.93 KB 0644
json_util_test.cpython-36.opt-1.pyc File 17.19 KB 0644
json_util_test.cpython-36.pyc File 17.19 KB 0644
jwa.cpython-36.opt-1.pyc File 7.73 KB 0644
jwa.cpython-36.pyc File 7.73 KB 0644
jwa_test.cpython-36.opt-1.pyc File 9.67 KB 0644
jwa_test.cpython-36.pyc File 9.67 KB 0644
jwk.cpython-36.opt-1.pyc File 11.66 KB 0644
jwk.cpython-36.pyc File 11.66 KB 0644
jwk_test.cpython-36.opt-1.pyc File 12.73 KB 0644
jwk_test.cpython-36.pyc File 12.73 KB 0644
jws.cpython-36.opt-1.pyc File 12.1 KB 0644
jws.cpython-36.pyc File 12.49 KB 0644
jws_test.cpython-36.opt-1.pyc File 9.4 KB 0644
jws_test.cpython-36.pyc File 9.4 KB 0644
magic_typing.cpython-36.opt-1.pyc File 775 B 0644
magic_typing.cpython-36.pyc File 775 B 0644
magic_typing_test.cpython-36.opt-1.pyc File 1.07 KB 0644
magic_typing_test.cpython-36.pyc File 1.07 KB 0644
test_util.cpython-36.opt-1.pyc File 2.77 KB 0644
test_util.cpython-36.pyc File 2.77 KB 0644
util.cpython-36.opt-1.pyc File 9.76 KB 0644
util.cpython-36.pyc File 9.84 KB 0644
util_test.cpython-36.opt-1.pyc File 11.62 KB 0644
util_test.cpython-36.pyc File 11.62 KB 0644