
    %
i'                     v   d dl Z d dlZd dlZd dlZd dlZd dlZ	 eZn# e$ r ej	        d          ZY nw xY wej
                            ej
                            ed                    Zd dlZeej        d <   d dlZd dlZd dlmZmZ d dlmZmZmZmZmZ dZd Zd Zd Zd	 Z G d
 de          Z  G d de          Z!d"                                d"                                d"                                d"                                gZ#d"                                g g g gZ$g ddgg g gZ%e ge!gg g gZ&d Z'd-dZ(d Z)e*dk    rr	  e j         ej	        dd         d          \  Z+Z,n"# e j-        $ rZ. e)e.           Y dZ.[.ndZ.[.ww xY we+D ]\  Z/Z0e/dk    redz  ZdZ1g Z2e,D ]EZ3	  e4e3          Z1e1d k     se1dk    r e5d          &# e5$ r e26                    e3           Y Bw xY we2r e)d            e              e(e1          \  Z7Z8er e9ed          r! e:d             e:d!            e:d"            e:d#e1e7;                                fz             edk    r8e7;                                d$k     r  e:d%e7;                                z              ee&          Z<e<=                    e7          Z>e8re>j?        @                    d'           e8D ]K\  ZA\  ZBZCd(                     ejD        eBeC                    ZEe>j?        F                    eA d)eE            Le>j?        @                    d* eGe8          z             e>H                                s e:d+d,            e              ejI                      e             e>H                                s ejJ        d           dS dS dS ).    Nz../..)
TestLoader
TestRunner)CapturingFunctionTestCase
CheckCleanRegisterPythonServerShellTestCaseTestCase   c                      ddl m}  |                                  	 	 |                                  d S # |                                  w xY w)Nr
   GenTestScripts) r   GenerateAllCleanAllr   s    C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\win32com/test/testall.pyGenerateAndRunOldStyler   &   s^             "!!!!!!!!!s   A	c                     dd l } dd l}t          j                            |j                  r<t          dk    rt          d|j        z             |                     |j                   dd l	}|j
        j                                         d S )Nr   r
   zDeleting files from %s)shutilwin32comospathisdir__gen_path__	verbosityprintrmtreewin32com.client.gencacheclientgencache__init__)r   r   s     r   CleanGeneratedr!   0   s    MMMOOO	w}}X*++ -q==*h.CDEEEh+,,,####O%%'''''    c                     	 |                      d          }t          j        d| |dz   d                    sn|dk     rdS | d |         } I| S )Nr
   
z\[\d+ refs\]r   r   )rfindrematch)datalast_line_poss     r   RemoveRefCountOutputr*   >   si    $

4((xma.?.A.A)BCC 	12N]N#$ Kr"   c                    t          j        |           }|                                                                }|                                }|r)t          |           |                    d| |fz             t          |          S )NzExecuting '%s' failed (%d))r   popenreadstripcloser   failr*   )cmdtestcasefr(   rcs        r   ExecuteSilentlyIfOKr5   K   sq    
A6688>>D	
B	 @d2c2Y>???%%%r"   c                       e Zd ZdZd ZdS )	PyCOMTestTc                 r   t          t          j                            t          j                            t
                    ddd          d           t          j                            t          j                            t                    d          }t          j         d| d}t          ||           }d S )Nz..serversztest_pycomtest.pyzPython.Test.PyCOMTestztestPyComTest.py "z	" -q 2>&1)
r   r   r   joindirname__file__	this_filesys
executabler5   )selffnamer1   r(   s       r   testitzPyCOMTest.testitY   s     	GLL))4<O  $		
 	
 	
 RW__Y779KLL335333"3--r"   N)__name__
__module____qualname__no_leak_testsrC    r"   r   r7   r7   V   s(        M. . . . .r"   r7   c                       e Zd Zd ZdS )	PippoTestc                    ddl m} t          |j        d           t          j        }t          j                            t          j        	                    t                    d          }| d| d}t          ||            d S )Nr   )pippo_serverzPython.Test.PippoztestPippo.pyr:   z" 2>&1)win32com.testrL   r   r=   r?   r@   r   r   r;   r<   r>   r5   )rA   rL   pythonrB   r1   s        r   rC   zPippoTest.testitl   s~    ......\24GHHHRW__Y77HH((5(((C&&&&&r"   N)rD   rE   rF   rC   rH   r"   r   rJ   rJ   k   s#        	' 	' 	' 	' 	'r"   rJ   ztestIterators testvbscript_regexp testStorage
          testStreams testWMI policySemantics testShell testROT
          testxslt testCollections
          errorSemantics.test testArrays
          testClipboard
          testConversionErrors
        zL
        testAXScript testDictionary testServers testvb testMarshal
        zwtestMSOffice.TestAll testMSOfficeEvents.test testAccess.test
           testExplorer.TestAll testExchange.test
        ztestmakepy.TestAll
        z*win32com.directsound.test.ds_test
        )z/cscript.exe /nologo //E:vbscript testInterp.vbszVBScript test worked OK)z3cscript.exe /nologo //E:vbscript testDictionary.vbsz2VBScript has successfully tested Python.Dictionaryc                 ^   |                      d          dk    r|                     d          \  }}n| }d }d|z   }	 t          |           t          j        |         }n8#  |                    |t          j                    d d         f           Y dS xY w|d nt          ||          }||fS )N.r   zwin32com.test.   )NN)findsplit
__import__r?   modulesappendexc_infogetattr)	test_nameimport_failuresmod_name	func_namefq_mod_namemodfuncs          r   get_test_mod_and_funcr`      s    ~~cQ'ooc22))	"X-K;k+&#,..!*<=>>>zz$44'#y*A*AD9s   !A 2Bc           	         t          j                    }g }t                      }t          t                    D ];}t
          |         D ]}t          ||          \  }}|t          d| d          |t          ||          }n:t          |d          r|
                                }n|                    |          }|                                dk    sJ d|            |                    |           t          |         D ](\  }	}
|                    t          |	|
                     )t           |         D ]4}|                    t           j                            |                     5=t          t                    D ]}t&          |         D ]}	 t)          |           n7#  |                    |t-          j                    d d         f           Y GxY wt,          j        |         }t          |d          r|
                                }n|                    |          }|                                dk    sJ d|            |                    |           ь||fS )Nzno such module '')descriptionsuiter   zNo tests loaded from rQ   )unittest	TestSuiter   range	testLevelunittest_modulesr`   ModuleNotFoundErrorr   hasattrrd   loadTestsFromModulecountTestCasesaddTestoutput_checked_programsr   custom_test_casesdefaultTestLoaderloadTestsFromTestCaseunittest_other_modulesrT   rV   r?   rW   rU   )
test_levelrd   rZ   loaderir[   r^   r_   testr1   output
test_classs               r   make_test_suiterz      s     EO\\F9 X X(+ 	  	 H-hHHIC{)*HX*H*H*HIII08LLL3(( ;99;;DD!55c::D&&((1,,,.Mc.M.M,,,MM$215 	6 	6KCMM-V445555+A. 	X 	XJMM(4JJ:VVWWWW	X 9    .q1 	  	 H8$$$$&&#,..!2D'EFFF+h'CsG$$ 7yy{{11#66&&((1,,,.Mc.M.M,,,MM$	  /!!s   F++2Gc                     t          |            t                       t          d           t          d           t          d           t          d           t          j        d           d S )Nzwin32com test suitezusage: testall [-v] test_levelz?  where test_level is an integer 1-3.  Level 1 tests are quick,z7  level 2 tests invoke Word, IE etc, level 3 take ages!r
   )r   r?   exit)whys    r   usager~      sc    	#JJJ	GGG	
   	
*+++	
KLLL	
CDDDHQKKKKKr"   __main__vz-vrQ      zOnly levels 1-4 are supportedz Test names are not supported yetgettotalrefcountz;This is a debug build - memory leak tests will also be run.z8These tests may take *many* minutes to run - be patient!z5(running from python.exe will avoid these leak tests)z4Executing level %d tests - %d test cases will be runF   |)r   z8*** The following test modules could not be imported ***r$   z: z#*** %d test(s) could not be run ***z********************z- unittest tests FAILED)r
   )Kgetoptr   r&   r?   	tracebackre   r=   r>   	NameErrorargvr   abspathr;   win32com_src_dirr   __path__	pythoncomwin32com.clientpywin32_testutilr   r   win32com.test.utilr   r   r   r   r	   r   r   r!   r*   r5   r7   rJ   rS   ri   rs   ro   rp   r`   rz   r~   rD   optsargserrorr}   optvalrh   
test_namesargint
ValueErrorrV   rd   rZ   rk   r   rm   
testRunnerrun
testResultstreamwritelnr[   exc_typeexc_valformat_exception_onlydescwritelenwasSuccessfulCoUninitializer|   rH   r"   r   <module>r      s    				 				 



     II   III 7??27<<	7#C#CDD   ( !          3 3 3 3 3 3 3 3              	" " "( ( (
 
 
& & &. . . . . . . .*
' 
' 
' 
' 
' 
' 
' 
'" EGG
EGGEGGEGG- :EGG
   	W	
  ( 	
 	     $(" (" (" ("V   z"V]38ABB<55
dd<   c







  S$;;NIIJ # #	#CI1}}	A j!@AAA !. 	# 	# 	#c"""""	# 20111N,_Y77E? 073*++ 	KEOPPPELMMMEIJJJB%..0012	
 	
 	
 >>e2244r99E#,,...///i000J&&J 	
!!F	
 	
 	
 .= 	; 	;)H)x99<Y<XwOOPPD##x$9$94$9$9::::!!1CC4H4HH	
 	
 	

 ##%% 3h1222JLLLIN##%% o l s6    22!E( (
F2FF&"G		G&%G&