Ë
    oj¢  ã                   ó¶   — d Z ddlZddlZddlZddlmZ dZ	 ddlm	Z	 ddl
mZ ej                  dd dk\  rd	Z G d
„ dej                  «      Zy# e$ r dZY Œ3w xY w)z
Test win32 shortcut script
é    N)Úunittest)Úshell)Úshortcutz"Only runs on Windows with win32comé   )é   é   zBroken on Python 3.7+.c                   ó    — e Zd ZeZdd„Zdd„Zy)ÚShortcutTestsNc                 ó   — t         }t        j                  j                  |«      }t	        j
                  |«      }| j                  «       dz   }|j                  |«       | j                  t        j                  j                  |«      «       t	        j                  |«      }|j                  t        j                  «      d   }| j                  |t        |«       d j!                  «       |j!                  «       «       y)z+
        Create a simple shortcut.
        ú.lnkr   N)Ú__file__ÚosÚpathÚbasenamer   ÚShortcutÚmktempÚsaveÚ
assertTrueÚexistsÚopenÚGetPathr   ÚSLGP_RAWPATHÚassertEqualÚlenÚlower)ÚselfÚtestFilenameÚbaseFileNameÚs1ÚtempnameÚscÚscPaths          ú</usr/lib/python3/dist-packages/twisted/test/test_shortcut.pyÚtest_createzShortcutTests.test_create   s»   € ô  ˆÜ—w‘w×'Ñ'¨Ó5ˆÜ×Ñ˜|Ó,ˆØ—;‘;“= 6Ñ)ˆØ
�‰�ÔØ�‰œŸ™Ÿ™ xÓ0Ô1Ü�]‰]˜8Ó$ˆØ—‘œE×.Ñ.Ó/°Ñ2ˆØ×Ñ˜¤ \Ó!2Ð 2Ð 4Ð5×;Ñ;Ó=¸|×?QÑ?QÓ?SÕTó    c                 ó  — t         j                  }t        j                  j	                  |«      }t        j                  «       }t        j                  |dd||d¬«      }| j                  «       dz   }|j                  |«       | j                  t        j                  j                  |«      «       t        j                  |«      }|j                  t        j                   «      d   }| j#                  |t%        |«       d j'                  «       |j'                  «       «       | j#                  |j)                  «       d«       | j#                  |j+                  «       |«       | j#                  |j-                  «       |df«       y)zZ
        Create a shortcut to the Python executable,
        and set some values.
        z-VzThe Python executableé   )r   Ú	argumentsÚdescriptionÚ
workingdirÚiconpathÚiconidxr   r   N)ÚsysÚ
executabler   r   r   ÚtempfileÚ
gettempdirr   r   r   r   r   r   r   r   r   r   r   r   r   ÚGetDescriptionÚGetWorkingDirectoryÚGetIconLocation)r   r   r   ÚtempDirr   r    r!   r"   s           r#   Útest_createPythonShortcutz'ShortcutTests.test_createPythonShortcut(   s1  € ô
 —~‘~ˆÜ—w‘w×'Ñ'¨Ó5ˆÜ×%Ñ%Ó'ˆÜ×ÑØØØ/ØØØô
ˆð —;‘;“= 6Ñ)ˆØ
�‰�ÔØ�‰œŸ™Ÿ™ xÓ0Ô1Ü�]‰]˜8Ó$ˆØ—‘œE×.Ñ.Ó/°Ñ2ˆØ×Ñ˜¤ \Ó!2Ð 2Ð 4Ð5×;Ñ;Ó=¸|×?QÑ?QÓ?SÔTØ×Ñ˜×*Ñ*Ó,Ð.EÔFØ×Ñ˜×/Ñ/Ó1°7Ô;Ø×Ñ˜×+Ñ+Ó-°¸¨|Õ<r%   )ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú
skipReasonÚskipr$   r5   © r%   r#   r
   r
      s   „ Ø€DóUô=r%   r
   )Ú__doc__Úos.pathr   r-   r/   Útwisted.trialr   r:   Úwin32com.shellr   Útwisted.pythonr   ÚImportErrorÚversion_infoÚTestCaser
   r<   r%   r#   ú<module>rE      sl   ðñó Û 
Û å "à€
ð6Ý$å'ð ×Ñ�A�aÐ˜FÒ"Ø)€Jô)=�H×%Ñ%õ )=øð ò 6Ø5‚Jð6ús   ˜A ÁAÁA