zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
U
Z±dê%ã    @s>ddlZddlZddlZddlZddlZddlZddlmZmZddl    m
Z
m Z ddl m Z mZejdkZejje ddZerŽdd    lmZn"e e¡dd    lmZW5QRXd
d œd d „Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z dd„Z!d d!„Z"ejjej# $d"¡d#dd$d%„ƒZ%ed&d'„ƒZ&dS)(éNé)Úgc_collect_harderÚskip_if_fbsd_pipes_broken)Ú_coreÚ move_on_after)Úwait_all_tasks_blockedÚcheck_one_way_streamÚposixz
posix only)Úreason)ÚFdStreamzTuple[FdStream, FdStream])ÚreturncÃst ¡\}}t|ƒt|ƒfS)zMakes a new pair of pipes.)ÚosÚpiper )ÚrÚw©rúQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\trio/tests/test_unix_pipes.pyÚ    make_pipes rcÃsXtƒIdH\}}z*ttddƒ}t | ¡d|d¡qWntk
rNYnX||fS)NZPIPE_BUFi óxr)rÚgetattrÚselectr ÚwriteÚfilenoÚBlockingIOError)ÚsrÚbuf_sizerrrÚmake_clogged_pipes rc
Ãspt ¡\}}t|ƒ4IdHšD}| ¡|ks.t‚| d¡IdHt |d¡dksRt‚t |¡W5QIdHRXdS©Ns123é)r rr rÚAssertionErrorÚsend_allÚreadÚclose)rrÚsendrrrÚtest_send_pipe7s  r$c
Ãspt ¡\}}t|ƒ4IdHšD}| ¡|ks.t‚t |d¡| d¡IdHdksRt‚t |¡W5QIdHRXdSr)r rr rrrÚ receive_somer")rrÚrecvrrrÚtest_receive_pipeAs   r'c
ƒs†tƒIdH\‰‰d‰‡‡fdd„}‡‡fdd„}t ¡4IdHš}| |¡| |¡W5QIdHRXˆ ¡IdHˆ ¡IdHdS)Nic“stˆƒ}ˆ |¡IdHdS©N)Ú    bytearrayr )Úbig)ÚcountrrrÚsenderOsz#test_pipes_combined.<locals>.senderc“sBtƒIdHd}|ˆkr2|tˆ d¡IdHƒ7}q|ˆks>t‚dS)Nri)rÚlenr%r)Zreceived)r+r!rrÚreaderSs
 z#test_pipes_combined.<locals>.reader)rrÚ open_nurseryÚ
start_soonÚaclose)r,r.Únr)r+r!rrÚtest_pipes_combinedKs
r3c
Ãs€t t¡tdƒW5QRXt ¡\}}t |¡t|ƒ4IdHš,}t t¡| d¡IdHW5QRXW5QIdHRXdS)Nr)    ÚpytestÚraisesÚ    TypeErrorr r rr"Ú
ValueErrorr%)rrrrrrÚtest_pipe_errorscs  
 r8c    Ãs”tƒIdH\}}| ¡| ¡}}~~tƒt t¡}t |¡W5QRX|jj    t    j
ks^t ‚t t¡}t |¡W5QRX|jj    t    j
kst ‚dSr() rrrr4r5ÚOSErrorr r"ÚvalueÚerrnoÚEBADFr)rrÚf1Úf2ÚexcinforrrÚtest_delns  r@c ÃsÜtƒIdH\}}|4IdHš$|4IdHšW5QIdHRXW5QIdHRX| ¡dks\t‚| ¡dkslt‚t t¡}t | ¡¡W5QRX|jj    t    j
ks¢t‚t t¡}t | ¡¡W5QRX|jj    t    j
ksØt‚dS)Néÿÿÿÿ) rrrr4r5r9r r"r:r;r<)rrr?rrrÚtest_async_with}s   rBc ƒsütƒIdH\}}| ¡}| ¡IdH| ¡IdHt ¡\}}||kr^t ||¡t |¡t|ƒ4IdHš~‰ˆ ¡|ks€t‚‡fdd„}t     
¡4IdHš@}|  |¡t ƒIdH| ¡IdHt ƒIdHt |¡W5QIdHRXW5QIdHRXdS)Nc“sˆ d¡IdHdkst‚dS)Né
ó)r%rr©Zr2rrÚ
expect_eof¢sz6test_misdirected_aclose_regression.<locals>.expect_eof) rrr1r rÚdup2r"r rrr/r0r)rrZold_r_fdZr2_fdZw2_fdrFÚnurseryrrErÚ"test_misdirected_aclose_regressionŽs"  
 
  rIc ƒs·fdd„}tjjj‰‡‡fdd„}| tjjd|¡tƒIdH\}‰|4IdHšlˆ4IdHšNt ¡4IdHš,}| |¡tƒIdH|     d¡IdHW5QIdHRXW5QIdHRXW5QIdHRXdS)Nc    “s,t tj¡ˆ d¡IdHW5QRXdS)NrC)r4r5rÚClosedResourceErrorr%r)rrrÚexpect_closedresourceerror¼szKtest_close_at_bad_time_for_receive_some.<locals>.expect_closedresourceerrorcŸs"ˆ||ŽIdHˆ ¡IdHdSr(©r1©ÚargsÚkwargs©Zorig_wait_readablerrrÚpatched_wait_readableÂszFtest_close_at_bad_time_for_receive_some.<locals>.patched_wait_readableÚ wait_readabler)
rÚ_runÚ TheIOManagerrRÚsetattrrr/r0rr )Ú monkeypatchrKrQrrHrrPrÚ'test_close_at_bad_time_for_receive_some´s 
 
 rWc ƒsä‡fdd„}tjjj‰‡‡fdd„}| tjjd|¡tƒIdH\‰}ˆ4IdHš‚|4IdHšdt ¡4IdHšB}| |¡tƒIdH|     d¡IdH}|r°|     d¡IdH}qšW5QIdHRXW5QIdHRXW5QIdHRXdS)Nc    “s,t tj¡ˆ d¡IdHW5QRXdS)Nsdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r4r5rrJr r)rrrrKØszGtest_close_at_bad_time_for_send_all.<locals>.expect_closedresourceerrorcŸs"ˆ||ŽIdHˆ ¡IdHdSr(rLrM©Zorig_wait_writablerrrÚpatched_wait_writableÞszBtest_close_at_bad_time_for_send_all.<locals>.patched_wait_writableÚ wait_writablei')
rrSrTrZrUrr/r0rr%)rVrKrYrrHZ received_datarrXrÚ#test_close_at_bad_time_for_send_allÐs 
 
 r[Zfreebsdz7no way to make read() return a bizarro error on FreeBSDc ÃsªtƒIdH\}}|4IdHš~|4IdHš`t dtjd¡}z<t || ¡¡t t    j
¡|  d¡IdHW5QRXW5t |¡XW5QIdHRXW5QIdHRXdS)Nú/rrC) rr ÚopenZ O_DIRECTORYr"rGrr4r5rZBrokenResourceErrorr%)rrÚdir_fdrrrÚ!test_bizarro_OSError_from_receiveûs r_cÃstttƒIdHdSr()rrrrrrrÚtest_pipe_fullysr`)'r;rr ÚtempfileÚsysr4Z_core.tests.tutilrrÚrrZtestingrrÚnamer    ÚmarkZskipifZ
pytestmarkZ _unix_pipesr r5Ú ImportErrorrrr$r'r3r8r@rBrIrWr[ÚplatformÚ
startswithr_r`rrrrÚ<module>s@
 
 
 &+
þ