test_smoke.cpython-314-pytest-8.4.2.pyc raw

   1  +
   2  %i}cRt^RIt^RIHuHt^RIt^RIt^RI	t
   3  ^RIt^RIH
t
Ht!RR4t!RR4tRtRtR	tR
   4  t^RItR#)uFSmoke tests — relay serves static files, app loads, basic WebSocket.N)	RELAY_URLWS_URLcNa]tRt^toRtRtRtRtRtRt	Rt
   5  RtR	tVt
R
   6  #)
TestRelayHTTPz0Verify the relay serves static files and NIP-11.c\PPVR,R24pVP4P	4pRqDV9qU'g\
   7  P!R
   8  V3RWC34R\
   9  P!V4RR\P!49g\
  10  P!V4'd\
  11  P!V4MR/,pRRV/,p\\
  12  P!V44hR;rER	qDV9qU'g\
  13  P!R
  14  V3RWC34R\
  15  P!V4RR\P!49g\
  16  P!V4'd\
  17  P!V4MR/,pRRV/,p\\
  18  P!V44hR;rER#)url/z<!DOCTYPE html>py1py3htmlassert %(py5)spy5Nz
id="app-root"inz%(py1)s in %(py3)s)
urllibrequesturlopenreaddecode
  19  @pytest_ar_call_reprcompare	_saferepr@py_builtinslocals_should_repr_global_nameAssertionError_format_explanation)selfrelayrespr
  20  @py_assert0@py_assert2@py_format4@py_format6s&&      (/home/mleku/src/smesh/test/test_smoke.pytest_index_htmlTestRelayHTTP.test_index_htmls~~%%ua&89yy{!!# (D((((( ((( ((((((D((((D((((((((&$&&&&&&&&&&&&&&$&&&&$&&&&&&&&c	\PPVR,R24pVPp^qCV8HqU'g\P
  21  !RV3RW434RR\P!49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;rTVP4P4p.pR	qV9qDq'gR
  22  qV9qp
  23  V
  24  'Eg\P
  25  !RV3RW34R\P!V	4RR\P!49g\P!V4'd\P!V4MR/,pR
RV/,qsPV4V'g\P
  26  !RX3RXV34R\P!V4RR\P!49g\P!V4'd\P!V4MR/,p
RRV
/,qPV4\P!V^4/,pRRV/,p\\P!V44hR;p
  27  ;p;p	;p;rR#)rz/$entry.mjspy0rpy2rassert %(py7)spy7Nz$startimportr	bodyz%(py7)spy10py12z%(py14)spy14zassert %(py17)spy17==z.%(py2)s
  28  {%(py2)s = %(py0)s.status
  29  } == %(py5)sr
)z%(py3)s in %(py5)s)z%(py10)s in %(py12)s)rrrstatusrrrrrrrrrrappend_format_boolop)rrr@py_assert1@py_assert4@py_assert3r#@py_format8r.r!r @py_assert9@py_assert11@py_format13@py_format15@py_format16@py_format18s&&               r$test_entry_mjsTestRelayHTTP.test_entry_mjss{~~%%uk&BC{{!c!c!!!!!{!!!!!!t!!!!t!!!{!!!c!!!!!!!!yy{!!#3x343383t#33333x333x3333334333343333333338t3338333333t3333t3333333333333333r'c	\PPVR,R24pVPp^qCV8HqU'g\P
  30  !RV3RW434RR\P!49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;rTVP4P4pR	qV9q'g\P
  31  !RV
  32  3RW34R
  33  \P!V	4RR\P!49g\P!V4'd\P!V4MR/,pR
RV/,p\\P!V44hR;rR#)rz
  34  /style.cssr)rr*rr+r,Nz--bgrr	r.rr3r5r
r)rrrr6rrrrrrrrrr)rrrr9r:r;r#r<r.r r!r"s&&          r$test_style_cssTestRelayHTTP.test_style_csss~~%%uj&AB{{!c!c!!!!!{!!!!!!t!!!!t!!!{!!!c!!!!!!!!yy{!!#~vvr'c	 \PPVR,R24pVPp^qCV8HqU'g\P
  35  !R	V3R
  36  W434RR\P!49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;rTR#)rz/sw-register.jsr)rr*rr+r,Nr3r5rrrr6rrrrrrrrrrrr9r:r;r#r<s&&      r$test_sw_registerTestRelayHTTP.test_sw_register!~~%%uo&FG{{!c!c!!!!!{!!!!!!t!!!!t!!!{!!!c!!!!!!!!r'c	 \PPVR,R24pVPp^qCV8HqU'g\P
  37  !R	V3R
  38  W434RR\P!49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;rTR#)rz/$sw/$entry.mjsr)rr*rr+r,Nr3r5rIrJs&&      r$
test_sw_entryTestRelayHTTP.test_sw_entry%rMr'c*\PPVR,RR/R7p\PPV4p\P
  39  !VP
44pVR,pRqeV8Hqw'gy\P!RV3R
WV34R\P!V4R\P!V4/,pRR	V/,p	\\P!V	44hR
  40  ;p;rv^qTR,qeV9qw'gy\P!RV3RWV34R\P!V4R\P!V4/,pRR	V/,p	\\P!V	44hR
  41  ;p;rvR
  42  #)rAcceptzapplication/nostr+json)headersnamesmeshrpy4assert %(py6)spy6Nsupported_nipsr3z%(py1)s == %(py4)sr
)z%(py1)s in %(py4)s)rrRequestrjsonloadsrrrrrr)
  43  rrreqrdatar r;r!@py_format5@py_format7s
  44  &&        r$
  45  test_nip11TestRelayHTTP.test_nip11)snn$$%L78%
  46  ~~%%c*zz$))+&F|&w&w&&&&&|&&&|&&&w&&&&&&&&*)********q***q************r'c
  47  D\PPVR,R24Rq"'gZ\P!R4R,R\P
  48  !V4/,p\
\P!V44hRpR# \PPdpTPpRqeT8Hqw'g\P!RT3RYV34RR	\P!49g\P!T4'd\P
  49  !T4MR	R
  50  \P
  51  !T4R\P
  52  !T4/,pRR
T/,p	\
\P!T	44hR;p;rvRp?R#Rp?ii;i)rz/nonexistent.xyzFzexpected 404z
  53  >assert %(py1)srNir)er*rr+r,r3)z,%(py2)s
  54  {%(py2)s = %(py0)s.code
  55  } == %(py5)s)rrrr_format_assertmsgrrrerror	HTTPErrorcoderrrr)
  56  rrr @py_format2rer9r:r;r#r<s
  57  &&        r$test_404TestRelayHTTP.test_4043s	!NN""eEl^3C#DE(5((.((((5((((((||%%	!66 S S=    6      1    1   6   S         	!s B
BF0A)FA:FFN)__name__
  58  __module____qualname____firstlineno____doc__r%rCrFrKrOrbrk__static_attributes____classdictcell__
__classdict__s@r$rrs0:'4""+!!r'rc*a]tRt^;toRtRtRtVtR#)TestRelayWebSocketu,Basic WebSocket connectivity (REQ → EOSE).c^RIp^RIp^RIp^RIpVR,pVR,pVP	Wg3^R7pVPVP!^44P4p	RVRVRV	R2p
  59  VPV
  60  P44R	pR
  61  V9dWPR4,
pK RqV9q'g\P!RV
3RW34R
\P!V4RR\P!49g\P !V4'd\P!V4MR/,pRRV/,p\#\P$!V44hR;r\&P(!RRR^/.4P4p\+VV4\-V4p\&P.!V4pV^,R8wd$\-V4p\&P.!V4pK1V^,pRpVV8Hq'gz\P!RV
3RVV34R
\P!V4R\P!V4/,pRRV/,p\#\P$!V44hR;p;p
pV^,pRpVV8Hq'gz\P!RV
3RVV34R
\P!V4R\P!V4/,pRRV/,p\#\P$!V44hR;p;p
p\&P(!RR.4P4p\+VV4\0P2!R4VP54R#)z2Connect via WebSocket, send REQ, expect EOSE back.Nhostport)timeoutzGET / HTTP/1.1
  62  Host: :z>
  63  Upgrade: websocket
  64  Connection: Upgrade
  65  Sec-WebSocket-Key: z
  66  Sec-WebSocket-Version: 13
  67  
  68  r's
  69  
  70  is101rr	rrrREQz
  71  smoke-testlimitEOSErVrWrXCLOSEg?r
rr3rZ)sockethashlibbase64oscreate_connection	b64encodeurandomrsendallencoderecvrrrrrrrrr\dumps
_ws_send_text_ws_read_framer]timesleepclose)rrrrrrrzr{sockws_key	handshakerr r!r"r#r^r_msgr;r`ra	close_msgs&&                     r$
test_req_eose TestRelayWebSocket.test_req_eose>shV}V}''a'@!!"**R.188:F!D6""#)*	
		
Y%%'(%IIdO#D~vvjj%|<=DDFdC d#jj!f!$'D**T"C1vvvv1v%%v%%%%%v%%%v%%%%%%%%%%%JJ67>>@	dI&
  72  
  73  3
  74  
  75  r'rmN)rnrorprqrrrrsrtrus@r$rxrx;s622r'rxcaa\P!^4o^RIpVPRR4o\	^^\S4,.4pVP
S4\	VV3Rl\\S4444pVP\V4\V4,4R# \dR#i;i)z-Send a WebSocket close frame (client-masked).N>Hic3`<"TF#pSV,SV^,,,xK%	R#5iNrm.0imaskpayloads& r$	<genexpr>!_ws_send_close.<locals>.<genexpr>{'M9LAwqzDQK//9L+.)rrstructpack	bytearraylenextendrangerbytes	Exception)rrheadermaskedrrs&   @@r$_ws_send_closerss
::a=Dkk$%G
dS\12
3F
  76  MM$
Ms7|9LM
MF
U6]U6]23

s*B22CCchaa^RIp\P!^4o\4pVP	^4\S4pV^~8dVP	^V,4MlVR8d4VP	^4VP
VPRV44M2VP	^4VP
VPRV44VP
S4\VV3Rl\\S4444pVP\V4\V4,4R#)z,Send a WebSocket text frame (client-masked).Nir>Qc3`<"TF#pSV,SV^,,,xK%	R#5irrmrs& r$r _ws_send_text.<locals>.<genexpr>rr)rrrrr7rrrrrr)rrrrlengthrrs&f    @r$rrs
::a=D
[F
  77  MM$
\F
|

dVm$	%

j!

fkk$/0

j!

fkk$/0
  78  MM$
Ms7|9LM
MFLLvv./r'c^RIp\V^4pV^,^,pV^~8Xd%VPR\V^44^,pM*V^8Xd$VPR\V^44^,p\W4#)z:Read a single WebSocket text frame (unmasked from server).Nrr)r_recv_exactunpack)rrhdrrs&   r$rrso
  79  dA
  80  C
Vd]F
}t[q%9:1=	3t[q%9:1=t$$r'c\4p\V4V8dHVPV\V4,
  81  4pV'g\R4hVP	V4KW\V4#)z
socket closed)rrrConnectionErrorrr)rnbufchunks&&  r$rrsN
  82  +C
  83  
c(Q,		!c#h,'!/22
  84  
  85  5:r')rrbuiltinsr_pytest.assertion.rewrite	assertionrewriterr\rurllib.requestrpytestconftestrrrrxrrrrrrmr'r$<module>rsJL
&,!,!^55p
0(	%
  86  r'