idddlmZddlZddlZddlmZddlmZddlmZddlmZdd lm Z dd lm Z dd l m Z Gd d ej ZGddeZdS))dequeN)config)fixtures) profiling) create_engine)MetaData)util)SessioncFeZdZejdZdZdZdZdZ dS)ReplayFixtureTestc/KdVdSN)selfargkws V/opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/testing/replay_fixture.py _dummy_ctxzReplayFixtureTest._dummy_ctxs cttjjjfd}t tjj|d}t||_||_ t||_ |  | |j||n-#||wxYwfd}t tjj|d}t||_||_ t||_ |  | t"j|j |dS#|j |wxYw)Nc>Sr)recorder)creator dbapi_sessionsrrz3ReplayFixtureTest.test_invocation..recorders ))''))44 4rF)ruse_native_hstore)ctxc,Sr)player)rsrr z1ReplayFixtureTest.test_invocation..player)s '')) )r)ReplayableSessionrdbpool_creatorr urlr metadataenginer session setup_engine _run_stepsrteardown_enginedisposercount_functionsclose)rrr'r rrs @@rtest_invocationz!ReplayFixtureTest.test_invocations)++ ).) 5 5 5 5 5 5 IM8u   !((  v    OOO 0 0 0  " " " NN      " " " NN     * * * * * IM6U   !((  v    OO 9O : : : L   NN      L   NN    sC*D- F<r2rctr)NotImplementedError)rrs rr*zReplayFixtureTest._run_stepsAs!###rN) __name__ __module__ __qualname__ contextlibcontextmanagerrr/r)r+r*rrrrrsn&&&P      $$$$$rrceZdZdZeZeZejr<e de e D ddDZ nje de e DdeD ddDZ d Zd Zd ZGd d eZGddeZdS)r!aA simple record/playback tool. This is *not* a mock testing class. It only records a session for later playback and makes no assertions on call consistency whatsoever. It's unlikely to be suitable for anything other than DB-API recording. cbg|],}|dtt|-S_ startswithgetattrtypes.0ts r zReplayableSession.Ss3 L L L1!,,s:K:K LWUA   L L Lrc8g|]}tt|SrrArBrCs rrFzReplayableSession.Us2   q!!   r) FunctionTypeBuiltinFunctionType MethodTypeBuiltinMethodType LambdaTypeUnboundMethodTypecbg|],}|dtt|-Sr=r?rCs rrFzReplayableSession.dsD<<,,E1%%rcZg|](}t|tst|n|)Sr) isinstancetyperCs rrFzReplayableSession.ksA$.a#6#6=DGGGArc8g|]}tt|SrrHrCs rrFzReplayableSession.qs2   E1%%   r)rIrJrKrLrMc,t|_dSr)rbufferr1s r__init__zReplayableSession.__init__~sgg rc8||j|Sr)RecorderrU)rbases rrzReplayableSession.recorders}}T[$///rc6||jSr)PlayerrUr1s rr zReplayableSession.players{{4;'''rc6eZdZdZdZedZdZdS)ReplayableSession.Recorderc"||_||_dSr)_buffer_subject)rrUsubjects rrVz#ReplayableSession.Recorder.__init__s!DL#DMMMrc fddD\}}||i|}t|tjvr8|tjt||S|||S)NcFg|]}t|Srobject__getattribute__rDxrs rrFz7ReplayableSession.Recorder.__call__..9''a00rr`r_)rRr!NativesappendCallable)rargsrrarUresults` r__call__z#ReplayableSession.Recorder.__call__s0OGV Wd)b))FF||#4#<<< /8999!tDzz&&111 f%%% rc|jSr)r`r1s r _sqla_unwrapz'ReplayableSession.Recorder._sqla_unwraps = rc t|S#t$rYnwxYwfddD\}} t|||}t|tjvr8|tjt||S|||S#t$r!|tjwxYw)NcFg|]}t|Srrdrgs rrFz?ReplayableSession.Recorder.__getattribute__..rirrj) rerfAttributeErrorrRr!rkrlrm NoAttribute)rkeyrarUros` rrfz+ReplayableSession.Recorder.__getattribute__s ..tS999!    0OGV "g77EE <<'8'@@@MM"3"<===%4::ff555MM&)))!M"    /;<<< s ++#C +C8Nr6r7r8rVrppropertyrrrfrrrrXr]s\ $ $ $     ! !  ! " " " " "rrXc6eZdZdZdZedZdZdS)ReplayableSession.Playerc||_dSr)r_)rrUs rrVz!ReplayableSession.Player.__init__s !DLLLrct|d}|}|tjur|S|SNr_)rerfpopleftr!rm)rrnrrUros rrpz!ReplayableSession.Player.__call__s?,,T9==F^^%%F*333  rcdSrrr1s rrrz%ReplayableSession.Player._sqla_unwraps4rc t||S#t$rYnwxYwt|d}|}|tjur|S|tjurt||Sr~)rerfrurr!rmrv)rrwrUros rrfz)ReplayableSession.Player.__getattribute__s ..tS999!    ,,T9==F^^%%F*333 ,888$S))) s  **Nrxrrrr[r{s\ " " "             rr[N)r6r7r8__doc__rermrvr py2ksetdirrB differencerkunion __builtins__valuesrVrr rXr[rrrr!r!EsvxxH&((K y+ # L LE L L L  *       " C SZZ  U)0022 Z        8000(((,",",",","6,",","\rr!) collectionsrr9rBrrrr r r ormr TestBaserrer!rrrrs 4$4$4$4$4$)4$4$4$nLLLLLLLLLLr