a  ze @sddlZddlZddlmZddlmZmZmZmZm Z m Z ddl m Z ddl mZeGdddejZeGdd d eZdS) N) ExitStack) distribution entry_pointsfilesPackageNotFoundErrorversion distributions) resources) requires_zlibc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)TestZipztest.test_importlib.datacCsLt|j|}|jt|}tjdt ||j tjj ddS)Nr) r rrootjoinpath enter_contextZas_filesyspathinsertstrcallbackpop)selffilenameZpkg_filefilerP/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_importlib/test_zip.py_fixture_on_pathszTestZip._fixture_on_pathcCs$t|_||jj|ddS)Nzexample-21.12-py3-none-any.whlrr Z addCleanupcloserrrrrsetUpsz TestZip.setUpcCs|tdddS)Nexample21.12 assertEqualrrrrrtest_zip_version szTestZip.test_zip_versioncCs6|ttdWdn1s(0YdS)Nzdefinitely-not-installed)Z assertRaisesrrrrrrtest_zip_version_does_not_match#s z'TestZip.test_zip_version_does_not_matchcCs>ttd}|d}||jd|d}||jddS)NZconsole_scriptsrz example:mainExample)dictrr"value)rZscriptsZ entry_pointrrrtest_zip_entry_points's zTestZip.test_zip_entry_pointscCs|tdddS)Nrzdoes not exist)Z assertIsNoner read_textrrrrtest_missing_metadata.szTestZip.test_missing_metadatacCs|tdddS)Nr%r r!rrrrtest_case_insensitive1szTestZip.test_case_insensitivecCs"tdD]}t|j|}qdSNrrrdistZ locate_filerrrrrr test_files4s zTestZip.test_filescCstttjddd}dS)N)r)listrrr)rZdistsrrrtest_one_distribution9szTestZip.test_one_distributionN) __name__ __module__ __qualname__r rrr#r$r(r*r+r0r3rrrrr sr c@seZdZddZddZdS)TestEggcCs$t|_||jj|ddS)Nzexample-21.12-py3.6.eggrrrrrr@sz TestEgg.setUpcCs"tdD]}t|j|}qdSr,r-r/rrrr0Gs zTestEgg.test_filesN)r4r5r6rr0rrrrr7>sr7)rZunittest contextlibrimportlib.metadatarrrrrr importlibr Z test.supportr ZTestCaser r7rrrrs    /