Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/python/test/__pycache__/ |
Upload File : |
o �b�� � @ s~ d Z ddlZddlmZ e�� � ejded� ddlmZm Z m Z mZmZm Z W d � n1 s2w Y G dd� de�ZG d d � d �ZG dd� dee�ZG d d� dee�ZG dd� d�ZG dd� deee�ZG dd� dee�ZG dd� dee�ZG dd� dee�ZG dd� dee�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e �ZG d#d$� d$e �ZG d%d&� d&e�ZdS )'z- Unit tests for L{twisted.python.constants}. � N)�TestCase�ignore)�category)�FlagConstant�Flags� NamedConstant�Names� ValueConstant�Valuesc @ �@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )�NamedConstantTestszy Tests for the L{twisted.python.constants.NamedConstant} class which is used to represent individual values. c C � G dd� dt �}|| _dS )zN Create a dummy container into which constants can be placed. c @ s e Zd ZdS )z%NamedConstantTests.setUp.<locals>.fooN)�__name__� __module__�__qualname__� r r �D/usr/lib/python3/dist-packages/twisted/python/test/test_constants.py�foo$ s r N)r � container)�selfr r r r �setUp s zNamedConstantTests.setUpc C s( t � }|�| jdd� | �d|j� dS )z� The C{name} attribute of a L{NamedConstant} refers to the value passed for the C{name} parameter to C{_realize}. �barN)r �_realizer �assertEqual�name�r r r r r � test_name) s zNamedConstantTests.test_namec C s* t � }|�| jdd� | �dt|�� dS )z� The string representation of an instance of L{NamedConstant} includes the container the instances belongs to as well as the instance's name. r Nz <foo=bar>)r r r r �reprr r r r �test_representation2 s z&NamedConstantTests.test_representationc C s6 t � }|�| jdd� | �||k� | �||k� dS )zG A L{NamedConstant} instance compares equal to itself. r N)r r r � assertTrue�assertFalser r r r � test_equality; s z NamedConstantTests.test_equalityc C sL t � }|�| jdd� t � }|�| jdd� | �||k� | �||k� dS )zf Two different L{NamedConstant} instances do not compare equal to each other. r N)r r r r r �r �first�secondr r r �test_nonequalityD s z#NamedConstantTests.test_nonequalityc C sD t � }|�| jdd� t � }|�| jdd� | �t|�t|�� dS )z� Because two different L{NamedConstant} instances do not compare as equal to each other, they also have different hashes to avoid collisions when added to a C{dict} or C{set}. r N)r r r �assertNotEqual�hashr"