a ze@sddlZddlZddlmZGdddZGdddeZGdddeZGd d d eZGd d d eZ Gd ddeZ GdddeZ Gddde Z Gdddej ZedkredS)N)ExtensionSaverc@s eZdZdS)CN__name__ __module__ __qualname__rrE/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_copyreg.pyrsrc@s eZdZdS) WithoutSlotsNrrrrr r sr c@seZdZdZdS) WithWeakref) __weakref__Nrrr __slots__rrrr r sr c@seZdZdZdS) WithPrivate__spamNr rrrr rsrc@seZdZdZdS) _WithLeadingUnderscoreAndPrivaterNr rrrr rsrc@seZdZdZdS)___rNr rrrr rsrc@seZdZdZdS)WithSingleStringspamNr rrrr rsrc@seZdZdZdS) WithInherited)eggsNr rrrr rsrc@s<eZdZddZddZddZddZd d Zd d Zd S)CopyRegTestCasecCs|ttjtdddS)N) assertRaises TypeErrorcopyregpicklerselfrrr test_class"s zCopyRegTestCase.test_classcCs|ttjtdddSNznot a callable)rrrrtyperrrr test_noncallable_reduce&s z'CopyRegTestCase.test_noncallable_reducecCs|ttjtdtddSr )rrrrr"intrrrr test_noncallable_constructor*s  z,CopyRegTestCase.test_noncallable_constructorcCsddl}|d|ddS)NrT)copy assertEqual)rr&rrr test_bool.szCopyRegTestCase.test_boolc Csd\}}}t|}zR|ttj|||t||||tj||f|k|tj|||fk| |tj t||||ttj|||d|ttj|||d|ttj|dd|||ttj|dd|||ttj||dd||ttj||dd||dtjvr\|ttj|dd|dd|dW| n | 0| ||ftjdD]B}t|}z(t|||t|||W| n | 0qdD]}|ttj|||qdS)N)zjunk1 z junk2iͫr!)r!i)rl) rr ValueErrorrremove_extension add_extensionZ assertTrue_extension_registry_inverted_registryZ assertNotIn_extension_cacheZrestore)rmodfunccodeerrr test_extension_registry2sZ            z'CopyRegTestCase.test_extension_registrycCs|ttg|ttgdg}|tt|dg}|tt||ttdg|ttdgddg}| tt }| |||dS)NZ_WithPrivate__spamZ&_WithLeadingUnderscoreAndPrivate__spamrrr) r'r _slotnamesr r rrrrsortr)rZexpectedresultrrr test_slotnamesls  zCopyRegTestCase.test_slotnamesN) rrrrr#r%r(r4r8rrrr r s :r__main__)rZunittestZtest.pickletesterrrobjectr r rrrrrZTestCaserrmainrrrr s ]