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.csRfddjD_tdr>jjfddjD_tjj_ 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 subclassesr 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__rrrrr 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) InspectLoaderr/)r'r(ExtensionFileLoaderNr+rrrrr0Vsr0c@seZdZdgZdgZdS)ExecutionLoaderr0r1Nr+rrrrr2`sr2c@seZdZddgZddgZdS) FileLoaderr.r2SourceFileLoaderSourcelessFileLoaderNr+rrrrr3jsr3c@seZdZddgZdgZdS) SourceLoaderr.r2r4Nr+rrrrr6tsr6Fc sFdur|jfddtD}fddtj||fi|DS)Ncsi|]\}}|t|qSrr)r kindZsplitabc)namerr sz'make_abc_subclasses..csi|]}|jr|n|qSr)_KIND)r cls)instrrr9s)r!r items test_utilZ split_frozen)Z base_classr8r<kwargsbaser)r<r8rmake_abc_subclassess  rAc@seZdZeddZdS)ABCTestHarnesscCs|j|j}|}||j_|SN)SPLITr: __class__ins)rr;rFrrrrFs zABCTestHarness.insN)r!r"r#propertyrFrrrrrBsrBcseZdZfddZZS)r%cst||SrC)super find_module)rfullnamepathrErrrIszMetaPathFinder.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|jdSrCrFinvalidate_cachesrrrrtest_invalidate_cachessz2MetaPathFinderDefaultsTests.test_invalidate_cachesN)r!r"r#rAr%rDrUrXrrrrrNsrNcseZdZfddZZS)r,cs t|SrC)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|jdSrCrVrrrrrXsz3PathEntryFinderDefaultsTests.test_invalidate_cachesN) r!r"r#rAr,rDr]rIrXrrrrr[sr[cseZdZfddZZS)r/cs t|SrC)rH load_modulerZrLrrr^szLoader.load_module)r!r"r#r^rMrrrLrr/sr/c@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#rAr/rDrbrerorrrrr_sr_cseZdZfddZZS)r.cs t|SrC)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#rAr.rDrtrrrrrrsrrcs(eZdZfddZfddZZS)r0cs t|SrC)rH is_packagerZrLrrruszInspectLoader.is_packagecs t|SrC)rH get_sourcerZrLrrrvszInspectLoader.get_source)r!r"r#rurvrMrrrLrr0s 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_ILrDrxryrrrrrw srwcseZdZfddZZS)r2cs t|SrC)rH get_filenamerZrLrrr{szExecutionLoader.get_filename)r!r"r#r{rMrrrLrr2sc@seZdZeZddZdS)ExecutionLoaderDefaultsTestscCs:|t|jdWdn1s,0YdSrf)rcrdrFr{rrrrtest_get_filename*s z.ExecutionLoaderDefaultsTests.test_get_filenameN)r!r"r#SPLIT_ELrDr}rrrrr|&sr|cs@eZdZfddZfddZfddZfddZZS) ResourceReadercstj|i|SrC)rH open_resourcerargsr?rLrrr6szResourceReader.open_resourcecstj|i|SrC)rH resource_pathrrLrrr9szResourceReader.resource_pathcstj|i|SrC)rH is_resourcerrLrrr<szResourceReader.is_resourcecstj|i|SrC)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|jdSrC)r\listrFrrrrr test_contentsSsz)ResourceReaderDefaultsTests.test_contentsN) r!r"r#rArrDrrrrrrrrrCs rc@s8eZdZeddZddZddZddZd d Zd S) MetaPathFinderFindModuleTestscsGfddd|jj}|S)NcseZdZdfdd ZdS)z@MetaPathFinderFindModuleTests.finder..MetaPathSpecFinderNcs||f|_SrC 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)rrPrQrIrRrrrKr8rTrrrrUhs   *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 ||_SrCr)rrJrrrrrszLPathEntryFinderFindLoaderTests.finder..PathEntrySpecFinder.find_spec)NrrrrrPathEntrySpecFindersr)r r,)r;rarrrrrsz%PathEntryFinderFindLoaderTests.findercCsr|d}d}|t||}Wdn1s80Y||d|g|d|||jdS)Nrgrr)rrPrQrYrRr\r)rrr8rTrrrrs  (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 ||_dSrC)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 r/)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!r8ZassertIsNotNone__path__r)rrr8rrrr test_freshs  0 z LoaderLoadModuleTests.test_freshcCsd}|}t|}|j|||_||_t|N|t j |<| ||j }| |t j || |t j |Wdn1s0YdSrf)rrhrirrrrmr>rrrr^rTr)rr8rrrTrrr 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|jdSrC)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`0YdSrC)rrd side_effectrcrrrmocked_get_coderrrrtest_get_code_ImportErrorRs   z6InspectLoaderLoadModuleTests.test_get_code_ImportErrorc Csn|R}d|_|t"|}||Wdn1sB0YWdn1s`0YdSrC)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 ||_dSrCrKrqrrr__init__szSourceOnlyLoader.__init__cCs||jkrt|jSrC)rKrsrrqrrrrps zSourceOnlyLoader.get_datacCs|jSrCrrZrrrr{szSourceOnlyLoader.get_filenamecCsdS)NzrrrrrrkszSourceOnlyLoader.module_reprN)r!r"r#rrrpr{rkrrrrrs rcs>eZdZdZd fdd ZfddZddZd d ZZS) r6rNcst||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&|jStdSrC)rKrHrprrOSErrorrqrLrrrps    zSourceLoader.get_datacCs||jkrt|j|jdS)N)mtimesize)rKrsrrrqrrr path_statss zSourceLoader.path_statscCst||j|<||jkSrC)rrr)rrKrrrrset_dataszSourceLoader.set_data)N) r!r"r#rrrpr r rMrrrLrr6s  )rrc@s*eZdZddddZddZddZd S) SourceLoaderTestHarnessTrucKsd|_|r&tj|jd|_|j|_n2d}tj|jdddg|_d|j|g|_|j|j|_|j|jfi||_ dS)NZpkgz __init__.pyrn.py) packageosrKjoinr8rrcached 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!r8__file__rK __cached__r __package__rrmrrsplitrl)rrvaluesrrr verify_modules z%SourceLoaderTestHarness.verify_modulecCsLt|j}|j|_|j|_|j|_|j |_ g|_ t ||j ||dSrC)rhrir8rKrrrrrrrmrrrr)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-8cSstdSrC)rrrrr raise_OSError*sz.raise_OSError) rrdecoder\rvr8rprcrd exception)rZexpected_sourcer"cmrrrry%s ,z%SourceOnlyLoaderTests.test_get_sourcecCs\|jdd||j|j|jdd||j|j||j|jddS)NFrTz .__init__)r assertFalserrur8rrrrrrx1s   z%SourceOnlyLoaderTests.test_is_packagecCs|j|j}||dSrCrrr8rrrrrrr9sz#SourceOnlyLoaderTests.test_get_codecCs"|j|jj|j}||dSrC)rrrrKr)rrrrrtest_source_to_code>sz)SourceOnlyLoaderTests.test_source_to_codec Cst|jt*tdt|j|j}Wdn1sF0Y| || |j t j |j g||jtjWdn1s0YdSr)r>rr8rrrrQrr^rr\rrrKdirnameassertInrrrrrrreCs  , z&SourceOnlyLoaderTests.test_load_modulec Cs|jddt|jlt*tdt|j |j}Wdn1sR0Y| || t |dWdn1s0YdS)NFrrr) rr>rr8rrrrQrr^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)encoderrrvr8r\)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}||dSrCr'r(rrrtest_code_with_everythingsz3SourceLoaderBytecodeTests.test_code_with_everythingcCsld|j_|t*|j|j}|j|Wdn1sB0Y|j|j }|j |dddS)NTr2) rrrcrrrrKrprr8r)rrrrrrtest_no_bytecodes  *z*SourceLoaderBytecodeTests.test_no_bytecodecCsVdD]L}|jj}||j_|jjdd|j_|j|j}|j|dd||j_qdS)N)rrTr2)rrrrr8r)rrZoriginalrrrrtest_code_bad_timestampsz1SourceLoaderBytecodeTests.test_code_bad_timestampcCs@|jdd|jjdd|j_|j|j}|j|dddS)N0000rr7Tr2)rrrrr8rr(rrrtest_code_bad_magics z-SourceLoaderBytecodeTests.test_code_bad_magiccCsFz8dt_d|j_|j|j}||j|jjWdt_ndt_0dS)NTr5F) rdont_write_bytecoderrrr8Z assertNotInrrr(rrrtest_dont_write_bytecodes z2SourceLoaderBytecodeTests.test_dont_write_bytecodec Csv|jdd|jjdj}z>|jjd`|j|j}||W||jjd_n||jjd_0dS)Nr9r:r)rrrEmror rr8r)rZoriginal_set_datarrrrtest_no_set_datas  z*SourceLoaderBytecodeTests.test_no_set_datacCs<dd}|jdd|t|j_|j|j}||dS)Ncsfdd}|S)NcsdSrCr)rr?excrrclosureszcSourceLoaderBytecodeTests.test_set_data_raises_exceptions..raise_exception..closurer)rArBrr@rraise_exceptions zRSourceLoaderBytecodeTests.test_set_data_raises_exceptions..raise_exceptionr9r:)rrjrr rr8r)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\rr8rrr/rrrtest_default_encodings    z0SourceLoaderGetSourceTests.test_default_encodingcCs8d}|d}d}|d|_||}|||dS)NrnrFu# coding: Latin-1 x='ü'r-rGrIrrrtest_decoded_sources    z.SourceLoaderGetSourceTests.test_decoded_sourcecCsFd}|d}d}|d|_tdd|}||||dS)NrnrFzx = 42 y = -13 r!T)rHr.rioIncrementalNewlineDecoderr#r\rv)rr8rrexpectrrrtest_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_ResourceLoaderInheritanceTestsr0Z$Frozen_InspectLoaderInheritanceTestsZ$Source_InspectLoaderInheritanceTestsr2Z&Frozen_ExecutionLoaderInheritanceTestsZ&Source_ExecutionLoaderInheritanceTestsr3Z!Frozen_FileLoaderInheritanceTestsZ!Source_FileLoaderInheritanceTestsr6Z#Frozen_SourceLoaderInheritanceTestsZ#Source_SourceLoaderInheritanceTestsrArBrNZFrozen_MPFDefaultTestsZSource_MPFDefaultTestsr[ZFrozen_PEFDefaultTestsZSource_PEFDefaultTestsr/r_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 [ #