python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_exception_hierarchy.cpython-312.opt-1.pyc

͑e)tddlZddlZddlZddlZddlZddlZddlmZGddeZGddeZ	GddeZ
Gd	d
e	e
ZGdde
e	ZGd
deZ
GddejZGddejZGddejZedk(rej&yy)N)EEXISTceZdZy)
SubOSErrorN__name__
__module____qualname__Q/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_exception_hierarchy.pyrr
rrceZdZfdZxZS)SubOSErrorWithInitc2||_t|	|yN)barsuper__init__)selfmessager	__class__s   rrzSubOSErrorWithInit.__init__s
!r)rrr	r
__classcell__rs@rrr
s
""rrceZdZfdZxZS)SubOSErrorWithNewc6t|||}||_|Sr)r__new__baz)clsrrrrs    rrzSubOSErrorWithNew.__new__swsG,r)rrr	rrrs@rrrs
rrceZdZy)SubOSErrorCombinedInitFirstNrr
rrr!r!r
rr!ceZdZy)SubOSErrorCombinedNewFirstNrr
rrr#r#r
rr#ceZdZdZy)SubOSErrorWithStandaloneInitcyrr
rs rrz%SubOSErrorWithStandaloneInit.__init__srN)rrr	rr
rrr%r%s
rr%cDeZdZdZdZdZdZdZeeZdZ	dZ
y)	
HierarchyTestc|jtjd|jtt|jt
ty)NOSError)assertEqualr+rassertIsIOErrorEnvironmentErrorr's rtest_builtin_errorsz!HierarchyTest.test_builtin_errors%s5))95

gw'

&0rcL|jtjt|jtjj
t|jtjj
t|jtjtyr)	r-socketerrorr+gaierror__base__herrortimeoutTimeoutErrorr's rtest_socket_errorsz HierarchyTest.test_socket_errors*sV

fllG,

foo..8

fmm,,g6

fnnl3rcL|jtjtyr)r-selectr3r+r's rtest_select_errorzHierarchyTest.test_select_error0s

fllG,rae
        +-- BlockingIOError        EAGAIN, EALREADY, EWOULDBLOCK, EINPROGRESS
        +-- ChildProcessError                                          ECHILD
        +-- ConnectionError
            +-- BrokenPipeError                              EPIPE, ESHUTDOWN
            +-- ConnectionAbortedError                           ECONNABORTED
            +-- ConnectionRefusedError                           ECONNREFUSED
            +-- ConnectionResetError                               ECONNRESET
        +-- FileExistsError                                            EEXIST
        +-- FileNotFoundError                                          ENOENT
        +-- InterruptedError                                            EINTR
        +-- IsADirectoryError                                          EISDIR
        +-- NotADirectoryError                                        ENOTDIR
        +-- PermissionError                        EACCES, EPERM, ENOTCAPABLE
        +-- ProcessLookupError                                          ESRCH
        +-- TimeoutError                                            ETIMEDOUT
    cPi}|jD]}|jd}|s|jd\}}}td|jj	dD]9}|dk(rtt|stt||tt|<;|S)Nz+-  z, ENOTCAPABLE)	
splitlinesstrip	partitionfiltersplithasattrerrnogetattrbuiltins)s_maplineexcname_errnameserrnames       r	_make_mapzHierarchyTest._make_mapFsLLN	KD::e$D#'>>##6 GQ!$(8(>(>t(DE
Km+GE74K07'0JWUG,-
K	Krcttd}|jt|t|j
j
D],\}}t|d}|jt||.ttjt|j
z
}|D]7}t|d}|jt|tt|9y)NBad file descriptorzSome message)r+rr-typeFileExistsErrorrJitemssetrF	errorcoderepr)reerrcodeexc
othercodess     rtest_errno_mappingz HierarchyTest.test_errno_mappingTs
F12

d1g/ IIOO-	(LGS0AMM$q'3'	()C		N:
!	5G0AMM$q'7DG4	5rc(d}	t||jd|jtj
j
|	t	j||jdy#t$rYawxYw#t$rYywxYw)N some_hopefully_non_existing_filez&should have raised a FileNotFoundError)openfailFileNotFoundErrorassertFalseospathexistsunlink)rfilenames  rtest_try_exceptzHierarchyTest.test_try_exceptbs5	@N
II>?	
12	@IIh
II>?!		!		s#A6B6	BB	BBN)rrr	r0r9r<_pep_maprPrJr]rir
rrr)r)#s41
4-
H"XD5@rr)cjeZdZdZdZejejdk(ddZ	dZ
y)AttributesTestctjdk(r |jdtty|jdtty)Nntwinerror)rdnameassertIndirr+assertNotInr's rtest_windows_errorz!AttributesTest.test_windows_error|s3
77d?MM*c'l3ZW6rc|ttdd}|j|jt|j|jdt|j|j
d|j|jdtjdk(r|j|jdyy)NFile already existsfoo.txtrrn)
r+rr,rFargsstrerrorrhrdrprorrYs  rtest_posix_errorzAttributesTest.test_posix_errorsF19=&)F+%:;Y/
77d?QZZ.rrnzWindows-specific testcNtdddd}|j|jd|j|jt|j|j
dt|j|jd|j|jdy)Nrrvrw)r+r,rorFrrxryrhrzs  rtest_errno_translationz%AttributesTest.test_errno_translations~
A,i=S)&)F+%:;Y/rc
d}tdD]W}t|d|}|jt5|jddd|jt5|`dddYtddd}|j|jdd|_|j|jd|`|jt5|jdddy#1swYxYw#1swYxYw#1swYyxYw)N)abcdrYrr)rangeBlockingIOErrorassertRaisesAttributeErrorcharacters_writtenr,)rrxnrYs    rtest_blockingioerrorz#AttributesTest.test_blockingioerrors(q	)Abq*A"">2
%$$
%"">2
)(
)
)		)
Ca(--q1 --q1
 


~
.	!
  	!	!
%
%
)
)	!	!s#
C!C-
C9!C*	-C6	9DN)rrr	rtr{unittest
skipUnlessrdrpr~rr
rrrlrlzs>7/XD*AB0C0!rrlc6eZdZdZdZdZdZdZdZdZ	y)	ExplicitSubclassingTestcbttd}|jt|ty)NrR)rrr-rSrzs  rr]z*ExplicitSubclassingTest.test_errno_mappings!v45

d1gz*rctdd}|j|jd|j|jdyNsome messagerrrr,rrxrzs  rtest_init_overriddenz,ExplicitSubclassingTest.test_init_overriddens7~u5&!23rctdd}|j|jd|j|jdy)Nrr)rrrrzs  rtest_init_kwdargsz)ExplicitSubclassingTest.test_init_kwdargss7~59&!23rctdd}|j|jd|j|jdyrrr,rrxrzs  rtest_new_overriddenz+ExplicitSubclassingTest.test_new_overriddens7ne4&!23rctdd}|j|jd|j|jdy)Nrr)rrrrzs  rtest_new_kwdargsz(ExplicitSubclassingTest.test_new_kwdargss7n%8&!23rctdd}|j|jd|j|jd|j|jdtdd}|j|jd|j|jd|j|jdyr)r!r,rrrxr#rzs  rtest_init_new_overriddenz0ExplicitSubclassingTest.test_init_new_overriddens'>&&!23&~u=&&!23rct}|j|jd|jt|dy)Nr
)r%r,rxstrrzs  rtest_init_standalonez,ExplicitSubclassingTest.test_init_standalones2(*$Q$rN)
rrr	r]rrrrrrr
rrrrs%+
4
4
4
4
4%rr__main__)rHrdr;r2rrFrr+rrrr!r#r%TestCaser)rlrrmainr
rr<module>rs	

		""
	"46G		!24F	
7
T@H%%T@n)!X&&)!X)%h//)%XzHMMOr