shell bypass 403
o
ab� � @ sr d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z G dd� dej
�Zedkr7e�
� dS dS )� N)�support)� os_helperc @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z d)dd�Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Ze�ejdkd�d d!� �Zd"d#� Zd$d%� Zd&d'� Zd(S )*�
NetrcTestCasec C s| t �|�}d}tjdkr|d7 }t�� \}}tj||d��
}|�|� W d � n1 s-w Y | � tj
|� t�|�S )N�w�cygwin�t)�mode)�textwrap�dedent�sys�platform�tempfile�mkstemp�os�fdopen�writeZ
addCleanup�unlink�netrc)�selfZ test_datar Ztemp_fdZ
temp_filename�fp� r �8/usr/local/python-3.10/lib/python3.10/test/test_netrc.py�make_nrc s
�
zNetrcTestCase.make_nrcc C sP | � d�}| �|jd d� | �|jd d� | � |�� �}| �|j|j� d S )Nz� machine host1.domain.com login log1 password pass1 account acct1
default login log2 password pass2
zhost1.domain.com)Zlog1Zacct1Zpass1�default)�log2NZpass2)r �assertEqual�hosts�__repr__)r �nrcZnrc2r r r �test_default s
�zNetrcTestCase.test_defaultc C s* | � d�}| �|jddgddgd�� d S )Nz� macdef macro1
line1
line2
macdef macro2
line3
line4
zline1
zline2
zline3
zline4
)Zmacro1Zmacro2)r r Zmacros)r r r r r �test_macros s
�zNetrcTestCase.test_macrosc C s&