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.datacCsbt|j|}|jt|}|jds:J|jtj dt ||j tj j ddS)Nzexample-r)r rrootjoinpath enter_contextZas_filename startswithsyspathinsertstrcallbackpop)selffilenameZpkg_filefilerP/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_importlib/test_zip.py_fixture_on_paths zTestZip._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_scriptsr!z example:mainExample)dictrr$value)rZscriptsZ entry_pointrrrtest_zip_entry_points's zTestZip.test_zip_entry_pointscCs|tdddS)Nr!zdoes not exist)Z assertIsNoner read_textrrrrtest_missing_metadata.szTestZip.test_missing_metadatacCs|tdddS)Nr'r"r#rrrrtest_case_insensitive1szTestZip.test_case_insensitivecCs2tdD]$}t|j|}d|vsJ|qdS)Nr!z.whl/rrdistZ locate_filerrrrrr test_files4s zTestZip.test_filescCs,tttjddd}t|dks(JdS)N)r)listrrrlen)rZdistsrrrtest_one_distribution9szTestZip.test_one_distributionN) __name__ __module__ __qualname__r rr r%r&r*r,r-r1r5rrrrr sr c@seZdZddZddZdS)TestEggcCs$t|_||jj|ddS)Nzexample-21.12-py3.6.eggrrrrrr @sz TestEgg.setUpcCs2tdD]$}t|j|}d|vsJ|qdS)Nr!z.egg/r.r0rrrr1Gs zTestEgg.test_filesN)r6r7r8r r1rrrrr9>sr9)rZunittest contextlibrimportlib.metadatarrrrrr importlibr Z test.supportr ZTestCaser r9rrrrs    /