o
    di                     @   sP   d dl Z d dlZd dlZd dlmZmZ d dlmZ dd ZG dd deZ	dS )    N)skipIfTestCase)maybe_awaitc                    s    fdd}|S )Nc                     s@   zt  }|d | | i |}|W |  S |  w )NF)asyncionew_event_loop	set_debugrun_until_completeclose)argskwargsloopresultfn N/home/ubuntu/.local/lib/python3.10/site-packages/aioitertools/tests/helpers.pywrapped   s   
zasync_test.<locals>.wrappedr   )r   r   r   r   r   
async_test   s   	r   c                   @   sL   e Zd Zedd Zedd Zeejdkdedd Z	ed	d
 Z
dS )HelpersTestc                    s   |  tdI d H d d S )N*   assertEqualr   )selfr   r   r   test_maybe_await   s   zHelpersTest.test_maybe_awaitc                    s&   dd }|  t| I d H d d S )Nc                      s   t dI d H  dS N-C6?r   r   sleepr   r   r   r   	forty_two#   s   z9HelpersTest.test_maybe_await_async_def.<locals>.forty_twor   r   r   r   r   r   r   test_maybe_await_async_def!   s   z&HelpersTest.test_maybe_await_async_def)      z@asyncio.coroutine removedc                    s,   t jdd }| t| I d H d d S )Nc                   s   s    t dE d H  dS r   r   r   r   r   r   r   ,   s   z9HelpersTest.test_maybe_await_coroutine.<locals>.forty_twor   )r   	coroutiner   r   r   r   r   r   test_maybe_await_coroutine)   s   
z&HelpersTest.test_maybe_await_coroutinec                    s0   dd }|  tt|ddI d H d d S )Nc                    s   t dI d H  | | S )Nr   r   )abr   r   r   multiply5   s   z6HelpersTest.test_maybe_await_partial.<locals>.multiply      r   )r   r   	functoolspartial)r   r'   r   r   r   test_maybe_await_partial3   s   &z$HelpersTest.test_maybe_await_partialN)__name__
__module____qualname__r   r   r    r   sysversion_infor$   r,   r   r   r   r   r      s    

r   )
r   r*   r0   unittestr   r   aioitertools.helpersr   r   r   r   r   r   r   <module>   s   