a 4êdgÙã@s|dZddlZddlmZe def¡e d¡ZWdƒn1sF0YGdd„dejƒZ dd „Z e d krxe ƒdS) z‡Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. éN)ÚsupportÚÚbinhexc@s8eZdZdd„Zdd„ZdZdd„Zdd „Zd d „Zd S) ÚBinHexTestCasecCs(tjd|_tjd|_tjd|_dS)NÚ1Ú2ZPvery_long_filename__very_long_filename__very_long_filename__very_long_filename__)rZ TESTFN_ASCIIÚfname1Úfname2Úfname3©Úself©r ú,/usr/local/lib/python3.9/test/test_binhex.pyÚsetUps  zBinHexTestCase.setUpcCs(t |j¡t |j¡t |j¡dS©N)rÚunlinkrr r r r r rÚtearDowns  zBinHexTestCase.tearDownsJack is my herocCsžt|jdƒ}| |j¡Wdƒn1s.0Yt |j|j¡t |j|j¡t|jdƒ}| ¡}Wdƒn1s‚0Y| |j|¡dS)NÚwbÚrb) ÚopenrÚwriteÚDATArr ZhexbinÚreadlineZ assertEqual)r ÚfZfinishr r rÚ test_binhexs*&zBinHexTestCase.test_binhexcCs0t|jdƒ}| ¡| tjtj|j|j¡dS)zÛ The testcase fails if no exception is raised when a filename parameter provided to binhex.binhex() is too long, or if the exception raised in binhex.binhex() is not an instance of binhex.Error. rN)rr ÚcloseZ assertRaisesrÚErrorr )r Zf3r r rÚ"test_binhex_error_on_long_filename)s z1BinHexTestCase.test_binhex_error_on_long_filenamecCsŒt|jdƒ}| |j¡Wdƒn1s.0Yt |j|j¡t|jdƒ}| ¡}Wdƒn1sr0Y| d|¡dS)Nrró )rrrrrr ÚreadZ assertNotIn)r rÚfpÚcontentsr r rÚtest_binhex_line_endings3s *&z'BinHexTestCase.test_binhex_line_endingsN) Ú__name__Ú __module__Ú __qualname__rrrrrr"r r r rr s   rcCst t¡dSr)rZ run_unittestrr r r rÚ test_main?sr&Ú__main__) Ú__doc__ZunittestÚtestrZcheck_warningsÚDeprecationWarningZimport_fresh_modulerZTestCaserr&r#r r r rÚs (2