| Server IP : 118.27.122.248 / Your IP : 216.73.216.17 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/__pycache__/ |
Upload File : |
3 � �^�T � @ s� d dl Z d dlZd dlZd dlZd dlmZ ejd�Zd dlm Z ejddgd� d dl T yejejjd �d Z W n eefk r� dZ Y nX ej� dd� Ze � dkr�d ndZed8k r�d ndZde j� f Zde Zde Zddefddefddefddefdddddgefd d!efd"d#d: efd%d&d; efd'd(efg ZG d)d*� d*ej�Z G d+d,� d,e �Z!ej"e d-�G d.d/� d/e ��Z#ej"ed0�G d1d2� d2e ��Z$d3d4� Z%e&d5k�r�e �s�e'd6d7� e%� dS )<� N)�support� threading)�machine�winreg�win)Zrequired_on)�*z--remote� � ZAMD64TF� z Python Test Key [%d] - Delete Mez SOFTWARE\zSOFTWARE\Classes\z Int Value�- zQword Valuel �w�*M z String ValzA string valueZStringExpandzThe path is %path%zMulti-stringZLotsZof�string�valueszRaw Datas binary dataz Big String�x� z Big Binary� xu Japanese 日本u 日本語c @ sT e Zd Zdd� Zdd� Zdefdd�Zdefdd �Zdd d�Z ddd �Z dd� ZdS )�BaseWinregTestsc C s | j tt� d S )N)�delete_tree�HKEY_CURRENT_USER� test_key_name)�self� r �0/opt/alt/python36/lib64/python3.6/test_winreg.py�setUp5 s zBaseWinregTests.setUpc C sv yt ||dt�}W n tk r& d S X x6yt|d�}W n tk rN P Y nX | j||� q*W t|� t||� d S )Nr )�OpenKey�KEY_ALL_ACCESS�OSError�EnumKeyr �CloseKey� DeleteKey)r �rootZsubkey�hkeyZ subsubkeyr r r r : s zBaseWinregTests.delete_tree�sub_keyc C s, t |ttd� ||t�}| j|jdk� |||�}x"tD ]\}}}t||d||� q8W t|�\} } }| j| dd� | j| dd� t|�\} } }| j| dd� | j| t t�d� t |�}t|� yt|� | jd� W n t k r� Y nX t |�} |j� yt| � | jd� W n t k �r& Y nX d S )Nz Default valuer r z"Not the correct number of sub keysz Not the correct number of valueszAIt appears the CloseKey() function does not close the actual key!zBIt appears the key.Close() function does not close the actual key!)�SetValuer �REG_SZ� assertTrue�handle� test_data� SetValueEx�QueryInfoKey�assertEqual�len�intr �failr �Close)r �root_key� subkeystr� CreateKey�keyr! � value_name� value_data� value_type�nkeys�nvalues� since_modZint_sub_keyZint_keyr r r �_write_test_dataJ s6 z BaseWinregTests._write_test_datac C s. t |t�}| j|dd� ||t�}|||���}d}xDyt||�}W n tk rX P Y nX | j|tkdd� |d }q4W | j|tt�d� x<tD ]4\} } }t|| �\}} | j|| d� | j| |d� q�W W d Q R X |j� t |d�}| j||d � yt |d� | j d � W n tk �r Y nX |j� d S )Nz Default valuez+Registry didn't give back the correct valuer Tz&Didn't read back the correct test datar z'Didn't read the correct number of itemsz!Could not directly read the valuezRead subkey value wrongz2Was able to get a second key when I only have one!)� QueryValuer r) � EnumValuer r&