a  ze؅@sddlZddlZddlZddlZddlmZddlZddlZddlmZddl Z ddl m Z e dZe dZe dZe d Z Gd d d ZGd d d eZe jeed\ZZGdddeZe jeed\ZZGdddeZe jeed\ZZGdddeZe jeed\ZZGdddeZe jeed\Z Z!GdddeZ"e je"ed\Z#Z$GdddeZ%e je%ed\Z&Z'd[ddZ(GdddZ)Gd d d ZGd!d"d"e)Z*e e*\Z+Z,Gd#ddZGd$d%d%e)Z-e e-\Z.Z/Gd&d'd'Z0Gd(d)d)e)Z1e e1\Z2Z3Gd*dde0ZGd+d,d,e)Z4e e4\Z5Z6Gd-dde0Ze(eZ7Gd.d/d/e)Z8e e8\Z9Z:Gd0ddeZe(eZ;Gd1d2d2e)ZGd3d4d4Z?Gd5d6d6e)Z@e e@\ZAZBGd7d8d8ZCe jeCee d9\ZDZEGd:d;d;ZFe jeFee ed<\ZGZHGd=d>d>ZIe jeIee d9\ZJZKGd?d@d@ZLe jeLe7dA\ZMZNGdBdCdCZOe jeOe7dA\ZPZQGdDdEdEZRe jeRe7ee dF\ZSZTGdGdHdHZUe jeUe;dI\ZVZWGdJdKdKZXe(eXdZYGdLddeXZ%e(e%e edMZZGdNdOdOZ[GdPdQdQe[Z\e je\e eYdR\Z]Z^e_ej`dSGdTdUdUe[Zae jeaee eZdV\ZbZcGdWdXdXZde jedeYdY\ZeZfegdZkrehdS)\N)support)mock)util importlibz importlib.abczimportlib.machineryzimportlib.utilc@s0eZdZdZgZgZddZddZddZdS) InheritanceTestszSTest that the specified class is a subclass/superclass of the expected classes.cshfddjD_tdr>jjfddjD_jsTjsTJjtjj _ dS)Ncsg|]}tj|qS)getattrabc.0 class_nameselfrP/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_importlib/test_abc.py sz*InheritanceTests.setUp..subclass_namescsg|]}t|qSrr r ) machineryrrr&s) superclass_names superclasseshasattrr rr subclasses __class__r Z_NAME_InheritanceTests__testrr)rrrsetUps   zInheritanceTests.setUpcCs.|jD]"}|t||jd||jqdS)Nz{0} is not a subclass of {1})r assertTrue issubclassrformat)rsubclassrrrtest_subclasses+s  z InheritanceTests.test_subclassescCs.|jD]"}|t|j|d||jqdS)Nz{0} is not a superclass of {1})rrrrr)rZ superclassrrrtest_superclasses1s  z"InheritanceTests.test_superclassesN) __name__ __module__ __qualname____doc__rrrr r!rrrrrs rc@seZdZdgZgdZdS)MetaPathFinderFinder)BuiltinImporterFrozenImporter PathFinderWindowsRegistryFinderNr"r#r$rrrrrrr&8sr&)r c@seZdZdgZdgZdS)PathEntryFinderr' FileFinderNr,rrrrr-Csr-c@seZdZdgZdS)ResourceLoaderLoaderN)r"r#r$rrrrrr/Msr/c@seZdZdgZgdZdS) InspectLoaderr0)r(r)ExtensionFileLoaderNr,rrrrr1Vsr1c@seZdZdgZdgZdS)ExecutionLoaderr1r2Nr,rrrrr3`sr3c@seZdZddgZddgZdS) FileLoaderr/r3SourceFileLoaderSourcelessFileLoaderNr,rrrrr4jsr4c@seZdZddgZdgZdS) SourceLoaderr/r3r5Nr,rrrrr7tsr7Fc sFdur|jfddtD}fddtj||fi|DS)Ncsi|]\}}|t|qSrr)r kindZsplitabc)namerr sz'make_abc_subclasses..csi|]}|jr|n|qSr)_KIND)r cls)instrrr:s)r"r items test_utilZ split_frozen)Z base_classr9r=kwargsbaser)r=r9rmake_abc_subclassess  rBc@seZdZeddZdS)ABCTestHarnesscCs|j|j}|}||j_|SN)SPLITr;rins)rr<rFrrrrFs zABCTestHarness.insN)r"r#r$propertyrFrrrrrCsrCcseZdZfddZZS)r&cst||SrD)super find_module)rfullnamepathrrrrIszMetaPathFinder.find_module)r"r#r$rI __classcell__rrrLrr&sc@s$eZdZeeZddZddZdS)MetaPathFinderDefaultsTestscCsF|t|jdd}Wdn1s.0Y||dSNZ something) assertWarnsDeprecationWarningrFrI assertIsNonerfoundrrrtest_find_modules ,z,MetaPathFinderDefaultsTests.test_find_modulecCs|jdSrDrFinvalidate_cachesrrrrtest_invalidate_cachessz2MetaPathFinderDefaultsTests.test_invalidate_cachesN)r"r#r$rBr&rErUrXrrrrrNsrNcseZdZfddZZS)r-cs t|SrD)rH find_loaderrrJrLrrrYszPathEntryFinder.find_loader)r"r#r$rYrMrrrLrr-sc@s,eZdZeeZddZddZddZdS)PathEntryFinderDefaultsTestscCsJ|t|jd}Wdn1s,0Y||dgfdSrO)rPrQrFrY assertEqualrSrrrtest_find_loaders *z-PathEntryFinderDefaultsTests.test_find_loadercCs|d|jddSrO)r\rFrIrrrrrIsz(PathEntryFinderDefaultsTests.find_modulecCs|jdSrDrVrrrrrXsz3PathEntryFinderDefaultsTests.test_invalidate_cachesN) r"r#r$rBr-rEr]rIrXrrrrr[sr[cseZdZfddZZS)r0cs t|SrD)rH load_modulerZrLrrr^szLoader.load_module)r"r#r$r^rMrrrLrr0sr0c@s,eZdZeeZddZddZddZdS)LoaderDefaultsTestscCsd}||j|dS)Nza spec)rRrF create_module)rspecrrrtest_create_modulesz&LoaderDefaultsTests.test_create_modulecCs:|t|jdWdn1s,0YdSrO) assertRaises ImportErrorrFr^rrrrtest_load_modules z$LoaderDefaultsTests.test_load_modulecCsbtd}|t|j|Wdn1s60Yt|}|j|_|t|dSNblah) types ModuleTypercNotImplementedErrorrF module_reprrepr __loader__r)rmodZ original_reprrrrtest_module_reprs   *z$LoaderDefaultsTests.test_module_reprN) r"r#r$rBr0rErbrerorrrrr_sr_cseZdZfddZZS)r/cs t|SrD)rHget_datarrKrLrrrpszResourceLoader.get_data)r"r#r$rprMrrrLrr/sc@seZdZeeZddZdS)ResourceLoaderDefaultsTestscCs:|t|jdWdn1s,0YdS)Nz /some/path)rcIOErrorrFrprrrr test_get_datas z)ResourceLoaderDefaultsTests.test_get_dataN)r"r#r$rBr/rErtrrrrrrsrrcs(eZdZfddZfddZZS)r1cs t|SrD)rH is_packagerZrLrrruszInspectLoader.is_packagecs t|SrD)rH get_sourcerZrLrrrvszInspectLoader.get_source)r"r#r$rurvrMrrrLrr1s c@s eZdZeZddZddZdS)InspectLoaderDefaultsTestscCs:|t|jdWdn1s,0YdSrf)rcrdrFrurrrrtest_is_packages z*InspectLoaderDefaultsTests.test_is_packagecCs:|t|jdWdn1s,0YdSrf)rcrdrFrvrrrrtest_get_sources z*InspectLoaderDefaultsTests.test_get_sourceN)r"r#r$SPLIT_ILrErxryrrrrrw srwcseZdZfddZZS)r3cs t|SrD)rH get_filenamerZrLrrr{szExecutionLoader.get_filename)r"r#r$r{rMrrrLrr3sc@seZdZeZddZdS)ExecutionLoaderDefaultsTestscCs:|t|jdWdn1s,0YdSrf)rcrdrFr{rrrrtest_get_filename*s z.ExecutionLoaderDefaultsTests.test_get_filenameN)r"r#r$SPLIT_ELrEr}rrrrr|&sr|cs@eZdZfddZfddZfddZfddZZS) ResourceReadercstj|i|SrD)rH open_resourcerargsr@rLrrr6szResourceReader.open_resourcecstj|i|SrD)rH resource_pathrrLrrr9szResourceReader.resource_pathcstj|i|SrD)rH is_resourcerrLrrr<szResourceReader.is_resourcecstj|i|SrD)rHcontentsrrLrrr?szResourceReader.contents)r"r#r$rrrrrMrrrLrr4s   rc@s4eZdZeeZddZddZddZddZ d S) ResourceReaderDefaultsTestscCs:|t|jdWdn1s,0YdSNZ dummy_file)rcFileNotFoundErrorrFrrrrrtest_open_resourceGs z.ResourceReaderDefaultsTests.test_open_resourcecCs:|t|jdWdn1s,0YdSr)rcrrFrrrrrtest_resource_pathKs z.ResourceReaderDefaultsTests.test_resource_pathcCs:|t|jdWdn1s,0YdSr)rcrrFrrrrrtest_is_resourceOs z,ResourceReaderDefaultsTests.test_is_resourcecCs|gt|jdSrD)r\listrFrrrrr test_contentsSsz)ResourceReaderDefaultsTests.test_contentsN) r"r#r$rBrrErrrrrrrrrCs rc@s8eZdZeddZddZddZddZd d Zd S) MetaPathFinderFindModuleTestscsGfddd|jj}|S)NcseZdZdfdd ZdS)z@MetaPathFinderFindModuleTests.finder..MetaPathSpecFinderNcs||f|_SrD called_for)rrJrKtargetrarr find_specbs zJMetaPathFinderFindModuleTests.finder..MetaPathSpecFinder.find_spec)Nr"r#r$rrrrrMetaPathSpecFinder`sr)r r&)r<rarrrrfinder^sz$MetaPathFinderFindModuleTests.findercCsZ|d}gd}d}|t|||}Wdn1sB0Y||dS)Nabcrg)rrPrQrIrRrrrKr9rTrrrrUhs   *z.MetaPathFinderFindModuleTests.test_find_modulecCs<t}|jd|}||}|ddd}|||dSrf)objectrspec_from_loaderrrr\rloaderrarrTrrr#test_find_spec_with_explicit_targetps  zAMetaPathFinderFindModuleTests.test_find_spec_with_explicit_targetcCsV|d}gd}d}|||d}|||||jd|||jddS)Nrrgrr)rrrRr\rrrrr test_no_specws  z*MetaPathFinderFindModuleTests.test_no_speccCs:t}|jd|}||}|dd}|||dSrf)rrrrrassertIsrrrr test_specs   z'MetaPathFinderFindModuleTests.test_specN) r"r#r$ classmethodrrUrrrrrrrr\s   r)r rc@s0eZdZeddZddZddZddZd S) PathEntryFinderFindLoaderTestscsGfddd|jj}|S)NcseZdZdfdd ZdS)zBPathEntryFinderFindLoaderTests.finder..PathEntrySpecFinderNcs ||_SrDr)rrJrrrrrszLPathEntryFinderFindLoaderTests.finder..PathEntrySpecFinder.find_spec)NrrrrrPathEntrySpecFindersr)r r-)r<rarrrrrsz%PathEntryFinderFindLoaderTests.findercCsr|d}d}|t||}Wdn1s80Y||d|g|d|||jdS)Nrgrr)rrPrQrYrRr\r)rrr9rTrrrrs  (z+PathEntryFinderFindLoaderTests.test_no_speccCsht}|jd|}||}|t|d}Wdn1sH0Y||d|jdS)Nrgr) rrrrrPrQrYrrrrrrtest_spec_with_loaders   (z4PathEntryFinderFindLoaderTests.test_spec_with_loadercCs||jdd}gd}||_||}|t|d}Wdn1sP0Y||d|||ddS)Nrgrrr) r ModuleSpecsubmodule_search_locationsrrPrQrYrRr\)rrapathsrrTrrrtest_spec_with_portionss  (z6PathEntryFinderFindLoaderTests.test_spec_with_portionsN)r"r#r$rrrrrrrrrrs   r)r rrc@s$eZdZddZddZddZdS)LoaderLoadModuleTestscCsGddd|jj}|S)Nc@s eZdZdZddZddZdS)z0LoaderLoadModuleTests.loader..SpecLoaderNcSs ||_dSrD)rTrmodulerrr exec_modulesz.SpecLoader.exec_modulecSsdS)z.Force some non-default module state to be set.TrrZrrrrusz;LoaderLoadModuleTests.loader..SpecLoader.is_package)r"r#r$rTrrurrrr SpecLoadersr)r r0)rrrrrrs zLoaderLoadModuleTests.loadercCs|}d}t|2|||j}|tj||Wdn1sN0Y|||j |||j j|||j |||j j | |j| |j|j jdSrf)rr?uncacher^rTrsysmodulesr\rm__spec__r"r9ZassertIsNotNone__path__r)rrr9rrrr test_freshs  0 z LoaderLoadModuleTests.test_freshcCsd}|}t|}|j|||_||_t|N|t j |<| ||j }| |t j || |t j |Wdn1s0YdSrf)rrhrirrrrmr?rrrr^rTr)rr9rrrTrrr test_reloads    z!LoaderLoadModuleTests.test_reloadN)r"r#r$rrrrrrrrs rc@s6eZdZd ddZddZddZdd Zd d ZdS) InspectLoaderSourceToCodeTestsNcCsBtd}|}|dur&||}n |||}t||j|S)z!Help with source_to_code() tests.rgN)rhriInspectLoaderSubclasssource_to_codeexec__dict__)rdatarKrrcoderrrsource_to_modules    z/InspectLoaderSourceToCodeTests.source_to_modulecCs0d}||}|t|d||jddS)N attr = 42attr*rrrr\rrsourcerrrrtest_source_to_code_sources z9InspectLoaderSourceToCodeTests.test_source_to_code_sourcecCs0d}||}|t|d||jddS)Ns attr = 42rrrrrrrtest_source_to_code_bytess z8InspectLoaderSourceToCodeTests.test_source_to_code_bytescCs*d}|}|d|}||j|dS)Nzpath/to/somewhererrr\ co_filename)rrKrrrrrtest_source_to_code_path s z7InspectLoaderSourceToCodeTests.test_source_to_code_pathcCs$|}|d}||jddS)Nrr)rrrrrrtest_source_to_code_no_paths z:InspectLoaderSourceToCodeTests.test_source_to_code_no_path)N)r"r#r$rrrrrrrrrrs  r)rc@s$eZdZddZddZddZdS)InspectLoaderGetCodeTestscCsptd}tj|jd(}d|_|}|d}Wdn1sH0Yt||j | |j ddS)Nrgrvrr) rhrirpatchrr return_valueget_coderrr\r)rrmockedrrrrr test_get_code s ( z'InspectLoaderGetCodeTests.test_get_codecCsVtj|jd(}d|_|}|d}Wdn1s>0Y||dS)Nrvrg)rrrrrrrR)rrrrrrrtest_get_code_source_is_None*s (z6InspectLoaderGetCodeTests.test_get_code_source_is_NonecCs@|}|t|dWdn1s20YdSrf)rrcrdrrrrrrtest_get_code_source_not_found2s z8InspectLoaderGetCodeTests.test_get_code_source_not_foundN)r"r#r$rrrrrrrrs rc@sDeZdZdZdZddZddZddZd d Zd d Z d dZ dS)InspectLoaderLoadModuleTestsz!Test InspectLoader.load_module().rgcCs t|j|tj|jdSrD)rZunload module_nameZ addCleanuprrrrrEs z"InspectLoaderLoadModuleTests.setUpcCsV|j|j|}t*tdt|jj |WdS1sH0YdSNignore) rrrwarningscatch_warnings simplefilterrQinit _bootstrap_load_unlocked)rrrarrrloadIs  z!InspectLoaderLoadModuleTests.loadcCstj|jdS)Nr)rrrrrrrr mock_get_codeOsz*InspectLoaderLoadModuleTests.mock_get_codec Csn|R}t|_|t"|}||Wdn1sB0YWdn1s`0YdSrD)rrd side_effectrcrrrmocked_get_coderrrrtest_get_code_ImportErrorRs   z6InspectLoaderLoadModuleTests.test_get_code_ImportErrorc Csn|R}d|_|t"|}||Wdn1sB0YWdn1s`0YdSrD)rrrcrdrrrrrrtest_get_code_NoneZs   z/InspectLoaderLoadModuleTests.test_get_code_NonecCsdtddd}|<}||_|}||}||tj|jWdn1sV0YdS)Nrrr) compilerrrrr\rrr)rrrrrrrrtest_module_returnedbs    z1InspectLoaderLoadModuleTests.test_module_returnedN) r"r#r$r%rrrrrrrrrrrr?sr)rrrc@s<eZdZdddddZddZddZd d Zd d Zd S)ExecutionLoaderGetCodeTestsFrvr{cCs8d\}}|rtj|jd}|r0tj|jd}||fS)N)NNrvr{)rrrExecutionLoaderSubclass)rrvr{source_mock_contextfilename_mock_contextrrr mock_methodsws  z(ExecutionLoaderGetCodeTests.mock_methodsc Csd}|jddd\}}|R}|.}d|_||_|}|d}Wdn1sT0YWdn1sr0Y||j|td}t||j ||j ddS)Nzblah.pyTrrrgr) rrrrr\rrhrirrr) rrKrr source_mock name_mockrrrrrrrs  F  z)ExecutionLoaderGetCodeTests.test_get_codecCsZ|jdd\}}|(}d|_|}|d}Wdn1sB0Y||dS)NT)rvrg)rrrrrR)rr_rrrrrrrs (z8ExecutionLoaderGetCodeTests.test_get_code_source_is_NonecCs@|}|t|dWdn1s20YdSrf)rrcrdrrrrrrs z:ExecutionLoaderGetCodeTests.test_get_code_source_not_foundc Cs|jddd\}}|R}|.}d|_t|_|}|d}Wdn1sP0YWdn1sn0Y||jdt d}t ||j ||j ddS)NTrrrgrr) rrrdrrrr\rrhrirrr)rrrrrrrrrrrtest_get_code_no_paths  F  z1ExecutionLoaderGetCodeTests.test_get_code_no_pathN)r"r#r$rrrrrrrrrrus   r)rc@s0eZdZdZddZddZddZdd Zd S) SourceOnlyLoadersN_ = '::'.join([__name__, __file__, __cached__, __package__, repr(__loader__)])cCs ||_dSrDrKrqrrr__init__szSourceOnlyLoader.__init__cCs||jkrt|jSrD)rKrsrrqrrrrps zSourceOnlyLoader.get_datacCs|jSrDrrZrrrr{szSourceOnlyLoader.get_filenamecCsdS)NzrrrrrrkszSourceOnlyLoader.module_reprN)r"r#r$rrrpr{rkrrrrrs rcs>eZdZdZd fdd ZfddZddZd d ZZS) r7rNcst||j|j|_t|j|_|dur8|jj }t |}| |j d| |j |j| |j |jt|j|jddd}| t|t||_i|_dS)NrrT) dont_inherit)rHrrcache_from_sourcerK bytecode_pathlenr source_size MAGIC_NUMBER bytearrayextendr _pack_uint32 source_mtimermarshaldumpsbytesbytecodewritten)rrKmagicr code_objectrLrrrs    zSourceLoader.__init__cs.||jkrt|S||jkr&|jStdSrD)rKrHrprrOSErrorrqrLrrrps    zSourceLoader.get_datacCs||jkrt|j|jdS)N)mtimesize)rKrsrrrqrrr path_statss zSourceLoader.path_statscCst||j|<||jkSrD)rrr)rrKrrrrset_dataszSourceLoader.set_data)N) r"r#r$rrrpr r rMrrrLrr7s  )rrc@s*eZdZddddZddZddZd S) SourceLoaderTestHarnessTrucKsd|_|r&tj|jd|_|j|_n2d}tj|jdddg|_d|j|g|_|j|j|_|j|jfi||_ dS)NZpkgz __init__.pyrn.py) packageosrKjoinr9rrcached loader_mockr)rrur@rrrrrs zSourceLoaderTestHarness.setUpcCs||j|j||j|j||j|j||j|j||j |j |j d}||d|j||d|j||d|j||d|j||dt |j dS)Nz::rr)r\r"r9__file__rK __cached__r __package__rrmrrsplitrl)rrvaluesrrr verify_modules z%SourceLoaderTestHarness.verify_modulecCsLt|j}|j|_|j|_|j|_|j |_ g|_ t ||j ||dSrD)rhrir9rKrrrrrrrmrrrr)rrrrrr verify_codes  z#SourceLoaderTestHarness.verify_codeN)r"r#r$rrrrrrrr s  r c@sHeZdZdZddZddZddZdd Zd d Zd d Z ddZ dS)SourceOnlyLoaderTestszTest importlib.abc.SourceLoader for source-only loading. Reload testing is subsumed by the tests for importlib.util.module_for_loader. cCs|jjd}||j|j|dd}||j_|t}|j|jWdn1sb0Y||j j|jdS)Nutf-8cSstdSrD)rrrrr raise_OSError*sz.raise_OSError) rrdecoder\rvr9rprcrd exception)rZexpected_sourcer"cmrrrry%s ,z%SourceOnlyLoaderTests.test_get_sourcecCs\|jdd||j|j|jdd||j|j||j|jddS)NFrTz .__init__)r assertFalserrur9rrrrrrx1s   z%SourceOnlyLoaderTests.test_is_packagecCs|j|j}||dSrDrrr9rrrrrrr9sz#SourceOnlyLoaderTests.test_get_codecCs"|j|jj|j}||dSrD)rrrrKr)rrrrrtest_source_to_code>sz)SourceOnlyLoaderTests.test_source_to_codec Cst|jt*tdt|j|j}Wdn1sF0Y| || |j t j |j g||jtjWdn1s0YdSr)r?rr9rrrrQrr^rr\rrrKdirnameassertInrrrrrrreCs  , z&SourceOnlyLoaderTests.test_load_modulec Cs|jddt|jlt*tdt|j |j}Wdn1sR0Y| || t |dWdn1s0YdS)NFrrr) rr?rr9rrrrQrr^rr&rrrrrtest_package_settingsOs   , z+SourceOnlyLoaderTests.test_package_settingscCs\d}|d|j_|j|j}|||d}|d|j_|j|j}|||dS)Nu_ = 'ü'r!u# coding: latin-1 _ = ülatin-1)encoderrrvr9r\)rrreturned_sourcerrrtest_get_source_encoding[s z.SourceOnlyLoaderTests.test_get_source_encodingN) r"r#r$r%ryrxrr)rer,r0rrrrr s   r )rrzsys.dont_write_bytecode is truecs^eZdZdZddfdd ZddZdd Zd d Zd d ZddZ ddZ ddZ Z S)SourceLoaderBytecodeTestszsTest importlib.abc.SourceLoader's use of bytecode. Source-only testing handled by SourceOnlyLoaderTests. Fbytecode_writtencst||r||j|jjt|jj}| |j d| |j |jj | |j |jj | t|||jj|jt|dS)Nr)rHrr+rrrrrrrrrrrrrr\r)rrr3rrLrrrws  z%SourceLoaderBytecodeTests.verify_codecCs|j|j}||dSrDr'r(rrrtest_code_with_everythingsz3SourceLoaderBytecodeTests.test_code_with_everythingcCsld|j_|t*|j|j}|j|Wdn1sB0Y|j|j }|j |dddS)NTr2) rrrcrrrrKrprr9r)rrrrrrtest_no_bytecodes  *z*SourceLoaderBytecodeTests.test_no_bytecodecCsfdD]\}||jjksJ|jj}||j_|jjdd|j_|j|j}|j|dd||j_qdS)N)rrTr2)rrrrr9r)rrZoriginalrrrrtest_code_bad_timestampsz1SourceLoaderBytecodeTests.test_code_bad_timestampcCs@|jdd|jjdd|j_|j|j}|j|dddS)N0000rr7Tr2)rrrrr9rr(rrrtest_code_bad_magics z-SourceLoaderBytecodeTests.test_code_bad_magiccCsFz8dt_d|j_|j|j}||j|jjWdt_ndt_0dS)NTr5F) rdont_write_bytecoderrrr9Z assertNotInrrr(rrrtest_dont_write_bytecodes z2SourceLoaderBytecodeTests.test_dont_write_bytecodec Csv|jdd|jjdj}z>|jjd`|j|j}||W||jjd_n||jjd_0dS)Nr9r:r)rrrmror rr9r)rZoriginal_set_datarrrrtest_no_set_datas  z*SourceLoaderBytecodeTests.test_no_set_datacCs<dd}|jdd|t|j_|j|j}||dS)Ncsfdd}|S)NcsdSrDr)rr@excrrclosureszcSourceLoaderBytecodeTests.test_set_data_raises_exceptions..raise_exception..closurer)rArBrr@rraise_exceptions zRSourceLoaderBytecodeTests.test_set_data_raises_exceptions..raise_exceptionr9r:)rrjrr rr9r)rrCrrrrtest_set_data_raises_exceptionss   z9SourceLoaderBytecodeTests.test_set_data_raises_exceptions) r"r#r$r%rr4r6r8r;r=r?rDrMrrrLrr1ns     r1)rrrc@s(eZdZdZddZddZddZdS) SourceLoaderGetSourceTestsz2Tests for importlib.abc.SourceLoader.get_source().cCs8d}|d}d}|d|_||}|||dS)Nrnmod.fileux = "ü"r!SourceOnlyLoaderMockr.rrvr\rr9rrr/rrrtest_default_encodings    z0SourceLoaderGetSourceTests.test_default_encodingcCsPd}|d}d}|d|dks*J|d|_||}|||dS)NrnrFu# coding: Latin-1 x='ü'r-r!rGrIrrrtest_decoded_sources   z.SourceLoaderGetSourceTests.test_decoded_sourcecCsFd}|d}d}|d|_tdd|}||||dS)NrnrFzx = 42 y = -13 r!T)rHr.rioIncrementalNewlineDecoderr#r\rv)rr9rrexpectrrrtest_universal_newliness   z2SourceLoaderGetSourceTests.test_universal_newlinesN)r"r#r$r%rJrKrOrrrrrEs  rE)rH__main__)NF)irLrrrtestrrhZunittestrrrrr?Zimport_importlibrr rrr&Z test_bothZ%Frozen_MetaPathFinderInheritanceTestsZ%Source_MetaPathFinderInheritanceTestsr-Z&Frozen_PathEntryFinderInheritanceTestsZ&Source_PathEntryFinderInheritanceTestsr/Z%Frozen_ResourceLoaderInheritanceTestsZ%Source_ResourceLoaderInheritanceTestsr1Z$Frozen_InspectLoaderInheritanceTestsZ$Source_InspectLoaderInheritanceTestsr3Z&Frozen_ExecutionLoaderInheritanceTestsZ&Source_ExecutionLoaderInheritanceTestsr4Z!Frozen_FileLoaderInheritanceTestsZ!Source_FileLoaderInheritanceTestsr7Z#Frozen_SourceLoaderInheritanceTestsZ#Source_SourceLoaderInheritanceTestsrBrCrNZFrozen_MPFDefaultTestsZSource_MPFDefaultTestsr[ZFrozen_PEFDefaultTestsZSource_PEFDefaultTestsr0r_ZFrozen_LDefaultTestsZSourceLDefaultTestsrrZFrozen_RLDefaultTestsZSource_RLDefaultTestsrzrwZFrozen_ILDefaultTestsZSource_ILDefaultTestsr~r|ZFrozen_ELDefaultTestsZSource_ELDefaultsTestsrrZFrozen_RRDefaultTestsZSource_RRDefaultsTestsrZFrozen_MPFFindModuleTestsZSource_MPFFindModuleTestsrZFrozen_PEFFindLoaderTestsZSource_PEFFindLoaderTestsrZFrozen_LoaderLoadModuleTestsZSource_LoaderLoadModuleTestsrZFrozen_ILSourceToCodeTestsZSource_ILSourceToCodeTestsrZFrozen_ILGetCodeTestsZSource_ILGetCodeTestsrZFrozen_ILLoadModuleTestsZSource_ILLoadModuleTestsrZFrozen_ELGetCodeTestsZSource_ELGetCodeTestsrZ SPLIT_SOLZSPLIT_SLr r ZFrozen_SourceOnlyLoaderTestsZSource_SourceOnlyLoaderTestsZskipIfr<r1ZFrozen_SLBytecodeTestsZSourceSLBytecodeTestsrEZ%Frozen_SourceOnlyLoaderGetSourceTestsZ%Source_SourceOnlyLoaderGetSourceTestsr"mainrrrrs&       $            .* -,/; &&N [ #