관리-도구
편집 파일: test_Path.cpython-37.opt-1.pyc
B �]�o � @ s� d dl mZ d dlZd dlZG dd� dej�ZG dd� de�ZG dd� de�ZG d d � d e�ZG dd� de�ZG d d� de�Z G dd� de�Z ddd�Zddd�Ze dkr�e� dS )� )�supportNc @ sB e Zd Zdd� Zddd�Zdd� Zddd �Zd d� Zddd �ZdS )�TestCasec C s t j�| � | jj| _d S )N)r r �setUp�heapy�Path)�self� r �M/opt/alt/python37/lib64/python3.7/site-packages/guppy/heapy/test/test_Path.pyr s zTestCase.setUpNc C s� | � ||�}|d k r$| �t||�� |d kr6t|� nZt|�}|�d�r�|�d�s�| �|�d�� |dd� �d�}| �||k� n| �||� d S )N�<�>� ����,) �relation� assertTrue� isinstance�print�str� startswith�endswith�split�aseq)r �src�dstZrelstr�clas�rel�srr r r �chkrel s zTestCase.chkrelc G s* x$|D ]}| � |t||�d| � qW d S )Nz%s.)r �getattr)r r Zattrs�attrr r r � chkrelattr s zTestCase.chkrelattrc C sT | � ||�}|d krt|� n2|�� }t|�dkr:|d }| �t|�t|�d� d S )Nr r r )�shpathsr Zaslist�lenr r )r r r �expectr Zlir r r �chkpath s zTestCase.chkpathc C s | j �||�S )N)r r )r r r r r r r ( s zTestCase.relationc O s. | � |�}|d k r| � |�}|j|f|�|�S )N)�iso�get_shpaths)r r r �args�kwdsr r r r! + s zTestCase.shpaths)NN)N)N) �__name__� __module__�__qualname__r r r r$ r r! r r r r r s r c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zd d!� Zd"S )#�RelationTestCasec C s$ d}d}t tdd��}|||g}d S )N�v1�v2�d �� )�list�range)r r- r. �v3�xr r r �test_list_relation7 s z#RelationTestCase.test_list_relationc s( g � � fdd�}| � |jd � d� d S )Nc s � S )Nr r )� cellvaluer r �fF s z.RelationTestCase.test_cell_relation.<locals>.fr z %s->ob_ref)r �__closure__)r r7 r )r6 r �test_cell_relationC s z#RelationTestCase.test_cell_relationc s@ � fdd�}|j }� �|dd� � �|ddddd d ddd � d S )Nc s d} � | fS )N� r )�a)r r r r7 K s z.RelationTestCase.test_code_relation.<locals>.fr: z%s.co_consts[1]�co_code� co_consts�co_names�co_varnames�co_freevars�co_cellvars�co_filename�co_name� co_lnotab)�__code__r$ r )r r7 �cor )r r �test_code_relationJ s z#RelationTestCase.test_code_relationc C s� d}d}d}d}t td��}t tdd��}||||||i}| �||d� | �||d� | �||d � t| �||��t| �||��t| �||��g}|�� | �|d ddg� d S ) N�k1�k2r- r. r/ r0 z%s['k1']z%s['k2']z%s[(0, 1, 2, 3, 4, 5, ...)]z%s.keys()[0]z%s.keys()[1]z%s.keys()[2])�tupler2 r r r �sortr ) r rH rI r- r. Zk3r3 r4 Zksr r r �test_dict_relationW s z#RelationTestCase.test_dict_relationc s>