o
    f                     @   s\   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZmZ G dd deZdS )	    )
ModuleNode)ModuleScope)TransformTest)MethodDispatcherTransform)NormalizeTreeAnalyseDeclarationsTransformAnalyseExpressionsTransformInterpretCompilerDirectivesc                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )TestMethodDispatcherTransformNc                 C   sJ   | j d u r"d }dd }|t|t|i t|t|g}| |d| _ | j S )Nc                 S   s"   t dd d }t| jd | |di dS )Ntest)docbodyscopefull_module_namedirective_comments)r   r   pos)noder    r   ]/var/www/html/mig_web/myenv/lib/python3.10/site-packages/Cython/Compiler/Tests/TestVisitor.pyfake_module   s
   
z>TestMethodDispatcherTransform._build_tree.<locals>.fake_modulez
                cdef bytes s = b'asdfg'
                cdef dict d = {1:2}
                x = s * 3
                d.get('test')
            )_treer   r	   r   r   run_pipeline)selfcontextr   pipeliner   r   r   _build_tree   s   
z)TestMethodDispatcherTransform._build_treec                    sB   dg G  fdddt }|  }|d | | d d  d S )Nr   c                       s   e Zd Z fddZdS )z?TestMethodDispatcherTransform.test_builtin_method.<locals>.Testc                        d  d7  < |S )Nr      r   r   r   funcargsunboundcallsr   r   _handle_simple_method_dict_get(      z^TestMethodDispatcherTransform.test_builtin_method.<locals>.Test._handle_simple_method_dict_getN)__name__
__module____qualname__r$   r   r"   r   r   Test'   s    r)   r   r   r   assertEqualr   r)   treer   r"   r   test_builtin_method%   s
   z1TestMethodDispatcherTransform.test_builtin_methodc                    sV   ddd G  fdddt }|  }|d | | d d  | d d  d S )Nr   )bytesobjectc                       s$   e Zd Z fddZ fddZdS )z=TestMethodDispatcherTransform.test_binop_method.<locals>.Testc                    r   )Nr/   r   r   r   r"   r   r   #_handle_simple_method_bytes___mul__3   r%   zaTestMethodDispatcherTransform.test_binop_method.<locals>.Test._handle_simple_method_bytes___mul__c                    r   )Nr0   r   r   r   r"   r   r   $_handle_simple_method_object___mul__6   r%   zbTestMethodDispatcherTransform.test_binop_method.<locals>.Test._handle_simple_method_object___mul__N)r&   r'   r(   r1   r2   r   r"   r   r   r)   2   s    r)   r   r/   r0   r*   r,   r   r"   r   test_binop_method0   s   
z/TestMethodDispatcherTransform.test_binop_method)r&   r'   r(   r   r   r.   r3   r   r   r   r   r
   
   s
    r
   N)Cython.Compiler.ModuleNoder   Cython.Compiler.Symtabr   Cython.TestUtilsr   Cython.Compiler.Visitorr   #Cython.Compiler.ParseTreeTransformsr   r   r   r	   r
   r   r   r   r   <module>   s    