:վ06kSrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK J r SSK J r SSK J r "SS\R5r"SS \R5r\S :Xa\R$"5 gg) z#Test harness for the zipapp module.N) requires_zlib) os_helper)patchc\rSrSrSrSrSrSrSrSr Sr S r S r S r S r\"5S 5rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr \!RD"\#RHS:HS5\%RLS 55r'\!RD"\#RHS:HS5S!5r(S"r)g#)$ ZipAppTestz!Test zipapp module functionality.c[R"5nURUR5 [R "UR 5UlgNtempfileTemporaryDirectory addCleanupcleanuppathlibPathnametmpdirselfrs 7/opt/alt/python313/lib64/python3.13/test/test_zipapp.pysetUpZipAppTest.setUp4,,. 'll6;;/ cURS- nUR5 US- R5 URS- n[R"[ U5[ U55 UR UR55 gNsource __main__.py source.pyzrmkdirtouchzipappcreate_archivestr assertTrueis_filerrtargets rtest_create_archiveZipAppTest.test_create_archivescx'  - &&(|+c&k3v;7 ()rcURS- nUR5 US- R5 URS- n[R"X5 UR UR 55 gr)rr!r"r#r$r&r'r(s r test_create_archive_with_pathlib+ZipAppTest.test_create_archive_with_pathlib"sYx'  - &&(|+f- ()rcNURS- nUR5 US- R5 US- R5 US- R5 US- S- R5 [R"5n[ R "[U5U5 URS5 [R"US5nURSUR55 URS UR55 SSS5 g!,(df  g=f) Nrrfoobarz __init__.pyrrzfoo/zbar/) rr!r"ioBytesIOr#r$r%seekzipfileZipFileassertInnamelistrrr)zs r test_create_archive_with_subdirs+ZipAppTest.test_create_archive_with_subdirs+sx'  - &&( % % %- '..0c&k62 A __VS )Q MM&!**, / MM&!**, /* ) )s AD D$c>URS- nUR5 US- R5 US- R5 US- S- R5 US- S- R5 US- R5 [R"5n[ R "[U5U5 URS5 [R"US5nURUR5/S Q5 SSS5 g!,(df  g=f) Nrzed.pybinquxbazrrr2)rzbin/zbin/bazzbin/quxr?) rr!r"r3r4r#r$r%r5r6r7 assertEqualr9)rrr)zfs rtest_create_sorted_archive%ZipAppTest.test_create_sorted_archive:sx'  ( !!# % %% &&( %% &&( - &&(c&k62 A __VS )R   R[[]G I* ) )s "#D Dc$SnURS- nUR5 US- R5 US- R5 US- R5 URS- n[R"X#US9 [ R "US5nURSUR55 URSUR55 URSUR55 SSS5 g!,(df  g=f) Nc URS:g$)Nz.pyc)suffixpaths rskip_pyc_filesBZipAppTest.test_create_archive_with_filter..skip_pyc_filesMs;;&( (rrrtest.pyztest.pycrfilterr2) rr!r"r#r$r6r7r8r9 assertNotIn)rrLrr)r;s rtest_create_archive_with_filter*ZipAppTest.test_create_archive_with_filterJs )x'  - &&( ) ""$ * ##%|+f^D __VS )Q MM- 6 MM)QZZ\ 2   Z 6* ) )s A!D DcURnUS- R5 US- R5 URS- n[R"X5 [R "US5nUR [UR55S5 URSUR55 URSUR55 SSS5 g!,(df  g=f)NrrN target.pyzr2) rr"r#r$r6r7rClenr9r8r:s r"test_create_archive_self_insertion-ZipAppTest.test_create_archive_self_insertion\s - &&( ) ""$|+f- __VS )Q   S. 2 MM- 6 MM)QZZ\ 2* ) )s /A*C"" C0c URnUS- R5 US- nUR5 UR[R5 [R "X5 SSS5 g!,(df  g=f)NrrU)rr" assertRaisesr# ZipAppErrorr$r(s r"test_target_overwrites_source_file-ZipAppTest.test_target_overwrites_source_filejs] - &&(,&    v11 2  ! !& 13 2 2s A44 BcbSnURS- nUR5 US- R5 US- R5 US- R5 US- S- R5 URS- n[R"X#US9 [ R "US 5nUR[UR55S 5 URSUR55 URSUR55 SSS5 g!,(df  g=f) Nc&URSS:g$)Nrdummy)partsrJs rskip_dummy_dirIZipAppTest.test_create_archive_filter_exclude_dir..skip_dummy_dirxs::a=G+ +rrrrNraztest2.pyrrOr2rV) rr!r"r#r$r6r7rCrWr9r8)rrcrr)r;s r&test_create_archive_filter_exclude_dir1ZipAppTest.test_create_archive_filter_exclude_dirts ,x'  - &&( ) ""$ '   " ' J &--/|+f^D __VS )Q   S. 2 MM- 6 MM)QZZ\ 2* ) )s -A*D  D.cURS- nUR5 US- R5 [R"[ U55 URS- nUR UR55 grr )rrexpected_targets r"test_create_archive_default_target-ZipAppTest.test_create_archive_default_targets_x'  - &&(c&k*++ 4 //12rcURS- nUR5 US- R5 US- R5 URS- n[R"XSS9 [ R "US5nSH<nURURU5R[ R5 M> SSS5 g!,(df  g=f) NrrrNrT) compressedr2)rrN) rr!r"r#r$r6r7rCgetinfo compress_type ZIP_DEFLATED)rrr)r;rs r$test_create_archive_with_compression/ZipAppTest.test_create_archive_with_compressionsx'  - &&( ) ""$|+f> __VS )Q2  4!>!>!(!5!573* ) )s AC  CcJURS- nUR5 US- R5 URS- nUR[R 5 [R "[U5[U55 SSS5 g!,(df  g=f)Nrfoo.pyrrr!r"r[r#r\r$r%r(s r test_no_mainZipAppTest.test_no_mainspx'  ( !!#|+   v11 2  ! !#f+s6{ ;3 2 2s !*B B"cHURS- nUR5 US- R5 URS- nUR[R 5 [R "[U5[U5SS9 SSS5 g!,(df  g=f)Nrrr pkg.mod:fnmainrtr(s rtest_main_and_main_py ZipAppTest.test_main_and_main_pysrx'  - &&(|+   v11 2  ! !#f+s6{ N3 2 2s !)B B!cURS- nUR5 US- R5 URS- n[R"[ U5[ U5SS9 [ R"[ U5S5nURSUR55 URSURS55 SSS5 g!,(df  g=f) Nrrsrrxryr2rs pkg.mod.fn()) rr!r"r#r$r%r6r7r8r9readr:s rtest_main_writtenZipAppTest.test_main_writtensx'  ( !!#|+c&k3v;\J __S[# .! MM- 6 MM/166-+@ A/ . .s AC C#cURS- nUR5 US- R5 US- R5 URS- n[R"[ U5[ U5SS9 [ R"[ U5S5nURSUR5RS 55 SSS5 g!,(df  g=f) Nrrszbar.pyrrxryr2r) rr!r"r#r$r%r6r7rCr9countr:s rtest_main_only_written_once&ZipAppTest.test_main_only_written_oncesx'  ( !!# ( !!#|+c&k3v;\J __S[# .!   Q 2 2= A B/ . .s 0C C$c URS- nUR5 URS- n/SQnUHknURUS9 UR[R 5 [R "[U5[U5US9 SSS5 SSS5 Mm g!,(df  N=f!,(df  M=f)Nrr) r0zfoo:z:barz12:barza.b.c.:dz.a:bza:b.za:.bz a:silly namery)rr!subTestr[r#r\r$r%)rrr)problemsrzs rtest_main_validationZipAppTest.test_main_validationsx' |+ D4(&&v'9'9:))#f+s6{N;)(::)(s$ B6')B%B6% B3 /B66 C cpURS- nUR5 US- R5 URS- n[R"[ U5[ U55 UR S5nURURS5S5 SSS5 g!,(df  g=f)NrrrrbrV#!) rr!r"r#r$r%openassertNotEqualr~rrr)fs rtest_default_no_shebang"ZipAppTest.test_default_no_shebangsx'  - &&(|+c&k3v;7 [[ !   q 5 1  s <"B'' B5cURS- nUR5 US- R5 URS- n[R"[ U5[ U5SS9 UR S5nURURS5S5 URS UR55 SSS5 g!,(df  g=f) Nrrrpython interpreterrrVrspython ) rr!r"r#r$r%rrCr~readliners rtest_custom_interpreter"ZipAppTest.test_custom_interpretersx'  - &&(|+c&k3v;HM [[ !   QVVAY .   [!**, 7  s ;AC Cc,URS- nUR5 US- R5 [R"5n[ R "[U5USS9 URUR5RS55 g)Nrrrrs #!python ) rr!r"r3r4r#r$r%r&getvalue startswithr(s rtest_pack_to_fileobjZipAppTest.test_pack_to_fileobjsix'  - &&(c&k6xH )44]CDrc4URS- nUR5 US- R5 URS- n[R"[ U5[ U5SS9 UR [R"[ U55S5 gNrrrrrrr!r"r#r$r%rCget_interpreterr(s rtest_read_shebangZipAppTest.test_read_shebangsqx'  - &&(|+c&k3v;HM //F sx'  - &&(|+c&k3v;HM[[=0 c&k3z?M //J@$GrcURS- nUR5 US- R5 [R"5n[ R "[U5USS9 [R"5nURS5 [ R "X#SS9 URS5 [R"US5nUR[UR55S15 SSS5 g!,(df  g=f)Nrrrrrr2)rr!r"r3r4r#r$r%r5r6r7rCsetr9)rrr)rr;s rtest_content_of_copied_archive)ZipAppTest.test_content_of_copied_archiveIsx'  - &&(c&k6xHZZ\  AfdC __Z -   S. @. - -s +C>> D win32z*Windows does not support an executable bitcJURS- nUR5 US- R5 URS- n[R"[ U5[ U5SS9 UR UR5R[R-5 gr) rr!r"r#r$r%r&statst_modeS_IEXECr(s rtest_shebang_is_executable%ZipAppTest.test_shebang_is_executableXsu x'  - &&(|+c&k3v;HM  -- <=rcJURS- nUR5 US- R5 URS- n[R"[ U5[ U5SS9 UR UR5R[R-5 g)Nrrrr) rr!r"r#r$r% assertFalserrrr(s r!test_no_shebang_is_not_executable,ZipAppTest.test_no_shebang_is_not_executabledswx'  - &&(|+c&k3v;DI ..=>rrN)*__name__ __module__ __qualname____firstlineno____doc__rr*r-r<rErRrXr]rerirrprur{rrrrrrrrrrrrrrunittestskipIfsysplatformrskip_unless_working_chmodrr__static_attributes__rrrrs+0 ** 0I 7$ 323(3_ 7 7<O BC" O2 8EHD O L G L H A__S\\W,AC((>)C>__S\\W,AC?C?rrcp\rSrSrSrSrSrSrSrSr Sr \ "S \ RS 9S 5rS rS rg)ZipAppCmdlineTestipz$Test zipapp module command line API.c[R"5nURUR5 [R "UR 5Ulgr r rs rrZipAppCmdlineTest.setUptrrcURS- nUR5 US- R5 URS- n[R"X5 U$r)rr!r"r#r$r(s r make_archiveZipAppCmdlineTest.make_archiveysKx'  - &&(|+f- rc URS- nUR5 US- R5 [U5/n[R "U5 UR S5nURUR55 g)Nrrz.pyz) rr!r"r%r#rz with_suffixr&r')rrargsr)s rtest_cmdline_create%ZipAppCmdlineTest.test_cmdline_createsdx'  - &&(F } D##F+ ()rcUR5nURS- n[U5S[U5/n[R"U5 UR UR 55 gNrU-o)rrr%r#rzr&r')roriginalr)rs rtest_cmdline_copy#ZipAppCmdlineTest.test_cmdline_copysQ$$&|+H tS[1 D ()rcDUR5nURS- n[U5S[U5/nUR[5n[ R "U5 SSS5 URWRR5 g!,(df  N4=fr rrr%r[ SystemExitr#rzr& exceptioncoderrr)rcms rtest_cmdline_copy_inplace+ZipAppCmdlineTest.test_cmdline_copy_inplacest$$&|+H tS]3   z *b KK +  ))*+ *s B BcHUR5nURS- n[U5S[U5SS/nUR[5n[ R "U5 SSS5 URWRR5 g!,(df  N4=f)NrUrz-mzfoo:barrrs rtest_cmdline_copy_change_main/ZipAppCmdlineTest.test_cmdline_copy_change_mainsx$$&|+H tS[$ B   z *b KK +  ))*+ *s B B!z sys.stdout) new_callablecTUR5n[U5S/nUR[5n[R "U5 SSS5 UR WRRS5 UR UR5S5 g!,(df  NU=f)N--inforzInterpreter: ) rr%r[rr#rzrCrrr)r mock_stdoutr)rrs rtest_info_command#ZipAppCmdlineTest.test_info_commands""$F X&   z *b KK + **A. --/1HI + *s B B'cURS- n[U5S/nUR[5n[R "U5 SSS5 UR WRR5 g!,(df  N4=f)Nz dummy.pyzr) rr%r[rr#rzr&rr)rr)rrs rtest_info_error!ZipAppCmdlineTest.test_info_errors`{*F X&   z *b KK +  ))*+ *s A77 BrN)rrrrrrrrrrrrr3StringIOrrrrrrrrpsI.0 **++ r sk)   &"]?""]?@ J+))J+Z z MMOr