Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/test_shortcut.cpython-38.pyc

U

�`�[��@s�dZddlZddlZddlZddlmZdZzddlm	Z	ddl
mZWnek
r`dZYnXej
dd�dkrxd	ZGd
d�dej�ZdS)z
Test win32 shortcut script
�N)�unittest)�shell)�shortcutz"Only runs on Windows with win32com�)��zBroken on Python 3.7+.c@s eZdZeZdd�Zdd�ZdS)�
ShortcutTestscCs�t}tj�|�}t�|�}|��d}|�|�|�tj�	|��t�
|�}|�tj
�d}|�|t|�d���|���dS)z+
        Create a simple shortcut.
        �.lnkrN)�__file__�os�path�basenamer�Shortcut�mktemp�save�
assertTrue�exists�open�GetPathr�SLGP_RAWPATH�assertEqual�len�lower)�self�testFilename�baseFileName�s1�tempname�sc�scPath�r �</usr/lib/python3/dist-packages/twisted/test/test_shortcut.py�test_creates


�zShortcutTests.test_createcCs�tj}tj�|�}t��}tj|dd||dd�}|�	�d}|�
|�|�tj�|��t�
|�}|�tj�d}|�|t|�d���|���|�|��d�|�|��|�|�|��|df�dS)zZ
        Create a shortcut to the Python executable,
        and set some values.
        z-VzThe Python executable�)rZ	argumentsZdescriptionZ
workingdirZiconpathZiconidxr	rN)�sys�
executablerrr
�tempfileZ
gettempdirrrrrrrrrrrrrrZGetDescriptionZGetWorkingDirectoryZGetIconLocation)rrrZtempDirrrrrr r r!�test_createPythonShortcut*s,�

�z'ShortcutTests.test_createPythonShortcutN)�__name__�
__module__�__qualname__�
skipReason�skipr"r'r r r r!rsr)�__doc__�os.pathrr$r&Z
twisted.trialrr+Zwin32com.shellrZtwisted.pythonr�ImportError�version_infoZTestCaserr r r r!�<module>s