
    Vh                         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          J/home/dcms/DCMS/lib/python3.12/site-packages/twisted/test/test_shortcut.pytest_createzShortcutTests.test_create   s      ww''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   
 ~~ww''5%%'/
 ;;=6)
x01]]8$E../2\!2 2 45;;=|?Q?Q?ST**,.EF//17;++-|<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$' AaF")J)=H%% )=  65J6s   A AA