
    %
i                     2   d dl Z d dlZd dlmZmZ 	  e j                     n# e j        $ r d dlZY nw xY w G d dej                  Z	d Z
edk    rEd dlT  e            Z edd 	          gZ ed
e	j        ed          Zege_         ee           dS dS )    N)ExtensionErrorthreaded_extensionc                   *    e Zd ZdZd Zd Zd Zd ZdS )	ExtensionzPython ISAPI Testerc                 >   t          d                    |                    d                               |                    d          }|                    d          d         }t	          | |d           }|t          d| d           ||          }|d S |                    ddd	           t          d
|d|           t          d|           t          ||           t          d|           t          d|           |                                 d S )NzTester dispatching "{}"URL/zNo test named ''z200 OKzContent-type: text/html

Fz%<HTML><BODY>Finished running test <i>z</i>)filez<pre>z</pre>z</BODY></HTML>)printformatGetServerVariablesplitgetattrAttributeErrorSendResponseHeadersDoneWithSession)selfecburl	test_namemethresults         C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\isapi/test/extension_simple.pyDispatchzExtension.Dispatch   s1   '..s/D/DU/K/KLLMMM##E**IIcNN2&	tY--< !?9!?!?!?@@@c>F*KUSSS5y&sSSSSgC    f3hS!!!!S))))    c                     	 |                     d           t          d          # t          $ r)}|j        t          j        k    s
J |            Y d }~nd }~ww xY wdS )Nzfoo barzshould have failed!worked!)r   AssertionErrorr   errnowinerrorERROR_INVALID_INDEX)r   r   errs      r   test1zExtension.test1/   s    	B!!),,, !6777 	B 	B 	B9 <<<<c<<<<<<<<	Bys   $& 
AAAc                 n   |                     d          }ddz  }t          |          dk    rO|                     d          }d|z   dz   |z   dz   }|                    d	|           |                                 d S ||k    rd
t          |          fz  S dt          |          t          |          fz  S )NQUERY_STRINGxi4!  r   r   z
Location: ?z

z	301 Movedz-Total length of variable is %d - test worked!z4Unexpected query portion!  Got %d chars, expected %d)r   lenr   r   )r   r   qsexpected_querymeheaderss         r   test_long_varszExtension.test_long_vars7   s    "">22 tr77a<< &&u--B"R'#->KG##K999!!!4Bc"ggZOOIBN##M  r   c                 Z   t          |                    d                              d          d                   }|dk     rd|z  S |                    d          }t          |t                    s
J d            |t	          |                    d                    k    s
J d	            d
S )NSERVER_SOFTWAREr	      g      @z=This is IIS version %g - unicode only works in IIS6 and laterUNICODE_SERVER_NAMEzunexpected type!SERVER_NAMEz0Unicode and non-unicode values were not the samer   )floatr   r   
isinstancestr)r   r   veruss       r   test_unicode_varszExtension.test_unicode_varsM   s     C))*;<<BB3GGJKK99RUXXX""#899"c""66$666"S..}==>>>>>> ?>> yr   N)__name__
__module____qualname____doc__r   r%   r/   r:    r   r   r   r      sV          &    ,    r   r   c                      t                      S )N)r   r?   r   r   __ExtensionFactory__rA   ]   s    ;;r   __main__)*rC   )r   Flagspyisapi_testreplace)NameDescription
ScriptMapsScriptMapUpdate)win32apir"   isapir   r   GetConsoleTitleerrorwin32traceutilThreadPoolExtensionr   rA   r;   isapi.installISAPIParametersparamsScriptMapParamssmVirtualDirParametersr>   vdVirtualDirsHandleCommandLiner?   r   r   <module>rZ      sO     4 4 4 4 4 4 4 4H~   @ @ @ @ @"6 @ @ @H   z_F
 /Cq
1
1
1	2B		%!	
 
 
B Ff# s   " 33