gP|h d dl Z e j dd dk r7d dlZd dlZd dlmZ d dlmZmZm Z d dl mZ d Zd Z d Z G d de ZdS d dlmZ d d l mZ dS ) N ) ) _is_coroutine)ismethod isfunctionCO_COROUTINE)TestCasec | t | t j r!| j } t | t j !| S N) isinstance functoolspartialfunc)r s `/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/mock/backports.py_unwrap_partialr s: y011 9D y011 c t | r| j } t | t | } t | sdS t | j j |z S )zReturn true if ``f`` is a function (or a method or functools.partial wrapper wrapping a function) whose code object has the given ``flag`` set in its flags.F)r __func__r r bool__code__co_flags)fflags r _has_code_flagr sa qkk A qkk A!}} 5AJ'$.///r c \ t | t pt | dd t u S )z}Return true if the object is a coroutine function. Coroutine functions are defined with "async def" syntax. r N)r r getattrr )objs r iscoroutinefunctionr s0 3-- AC$//=@ r c > e Zd Zd fd Zd Zd Zd Zd fd Z xZS ) IsolatedAsyncioTestCaserunTestc f t | d | _ d | _ d S r )super__init___asyncioTestLoop_asyncioCallsQueue)self methodName __class__s r r% z IsolatedAsyncioTestCase.__init__( s1 GGZ((($(D!&*D###r c K t j x| _ }| d | d {V }| |J 3r )asyncioQueuer' set_resultget task_done)r( futqueuequerys r _asyncioLoopRunnerz*IsolatedAsyncioTestCase._asyncioLoopRunner- sm .5moo=D#eNN4 %#iikk))))))!!!}}} %r c J | j J t j }t j | | d || _ | }| | | | _ | | d S )NT) r&