Current File : //opt/imh-python/lib/python2.7/test/test_imageop.pyc
�
��Wc	@sdZddlmZmZmZmZedde�ZddlZddl	Z	ddl
Z
dZddddddd d"fZe
d
�ee�D��d#eZddZd$Zde
jfd��YZd�Zd�Zd�Zedkre�ndS(%s�Test script for the imageop module.  This has the side
   effect of partially testing the imgfile module as well.
   Roger E. Masse
i����(tverbosetunlinkt
import_moduletrun_unittesttimageopt
deprecatedNiiiii
iiccs|]}|VqdS(N((t.0tx((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pys	<genexpr>sitAiitInputValidationTestscBs/eZdd�Zd�Zd�Zd�ZRS(c
Gs�tt|�}x�tD]�}x�tD]�}t||�}|rL||9}n|tkred|}nt}|r�||||f|}	n|||f|}	y||	�Wq#ttjfk
r�q#Xq#WqWdS(NR(tgetattrRtVALUEStabstMAX_LENtAAAAAt
ValueErrorterror(
tselftnametsizetextratfunctheighttwidthtstrlentdatat	arguments((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyt_checks 



cGs(x!tD]}|j|||�qWdS(N(tSIZESR(RRRR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyt
check_size)s
cGs|j|d|�dS(N(RtNone(RRR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pytcheck-scCs|jddddd�|jddd�|jddd�|jd�|jdd�|jd	�|jd
�|jd�|jd�|jd
dd�|jd�|jd�|jd�|jd�|jd�|jtj��tjdddd�WdQXdS(Ntcropitscaleii����ttovideot	grey2monoi�t
grey2grey4t
grey2grey2tdither2monotdither2grey2t	mono2greyt
grey22greytrgb2rgb8trgb82rgbtrgb2greytgrey2rgbRii�(RRtassertRaisesRRR-(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyttest_input_validation0s"









N(t__name__t
__module__RRRRR/(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyR	s		c	Cs�tt�yddl}Wntk
r.dSXtjtdtjd�dtjd�t	dtjd�\}}}t
r�dGHntj|d||ddd	d	�}t
r�d
GHntj
|d||d	d	�}t
r�dGHntj|d||�}t
r
dGHntj|||�}t
r0d
GHntj|||�}t
rSdGHntj|||�}t
rvdGHntj|||�}t
r�dGHntj|||d�}t
r�dGHntj|||dd�}t
r�dGHntj|||�}t
rdGHntj|||�}	t
r.dGHntj|||�}
t
rQdGHntj|||�}
t
rtdGHntj|	||�}t
r�dGHntj|
||�}tdtjd�dS(Ni����ttestrgbtuuettesttrgbR iiiR!R"R*R+R,R-R#R(i�R&R$R%R't
grey42greyR)(RR	timgfiletImportErrortuutdecodetget_qualified_pathtostextseptgetimageRRR R!R"R*R+R,R-R#R(R&R$R%R'R6R)R(R7timageRRtnewimaget
scaleimaget
videoimaget	greyimaget	monoimaget
grey4imaget
grey2image((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyt	test_mainDsj

, $cCs�ddl}y|j|�}Wn/|jk
rPt|�}|j|�}nXtrod|t|�fGHn|j|�}||d|dfS(sUreturn a tuple consisting of
       image (in 'imgfile' format) width and height
    i����Ns)imgfile opening test image: %s, sizes: %sii(R7tgetsizesRR;Rtstrtread(RR7tsizesR?((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyR>�scCs�ddl}ddl}|j}y|jjt�g|}Wntk
rQnXx9|D]1}|jj||�}|jj|�rY|SqYW|S(s% return a more qualified path to namei����N(tsysR<tpathtdirnamet__file__t	NameErrortjointexists(RRLR<RMtdirtfullname((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyR;�s	

t__main__(iiiiii�i�i�i�i�I�i���I�i���(ii(t__doc__ttest.test_supportRRRRtTrueRR9R<tunittestRt_VALUESttupletreversedRRR
tTestCaseR	RGR>R;R0(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_imageop.pyt<module>s"$$
1	o