
    Yf                         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 n# e$ r dZY nw xY wej        dd         dk    rd	Z G d
 dej                  ZdS )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dS )ShortcutTestsreturnNc                 H   t           }t          j                            |          }t	          j        |          }|                                 dz   }|                    |           |                     t          j        	                    |                     t	          j
        |          }|                    t          j                  d         }|                     |t          |           d                                         |                                           dS )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          L/var/www/html/env/lib/python3.11/site-packages/twisted/test/test_shortcut.pytest_createzShortcutTests.test_create   s      w''55|,,;;==6)
x00111]8$$E.//2\!2!2 2 4 45;;==|?Q?Q?S?STTTTT    c                 x   t           j        }t          j                            |          }t          j                    }t          j        |dd||d          }| 	                                dz   }|
                    |           |                     t          j                            |                     t          j        |          }|                    t          j                  d         }|                     |t%          |           d                                         |                                           |                     |                                d           |                     |                                |           |                     |                                |df           dS )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(   sz   
 ~w''55%''/
 
 
 ;;==6)
x00111]8$$E.//2\!2!2 2 4 45;;==|?Q?Q?S?STTT**,,.EFFF//117;;;++--|<<<<<r&   )r   N)__name__
__module____qualname__
skipReasonskipr%   r6    r&   r$   r
   r
      sE        DU U U U= = = = = =r&   r
   )__doc__os.pathr   r.   r0   twisted.trialr   r:   win32com.shellr   twisted.pythonr   ImportErrorversion_infoTestCaser
   r<   r&   r$   <module>rE      s      



  " " " " " "
6$$$$$$''''''' 6 6 65JJJ6 AaCF"")J)= )= )= )= )=H% )= )= )= )= )=s   % //