%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/python/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/python/test/__pycache__/test_constants.cpython-312.pyc |
� Ϫ�f�� � � � d Z ddlZddlmZ ej � 5 ej de�� ddlmZm Z m Z mZmZm Z ddd� G d� de� Z G d � d � Z G d� dee� Z G d � dee� Z G d� d� Z G d� deee� Z G d� dee� Z G d� dee� Z G d� dee� Z G d� dee� Z G d� de� Z G d� de� Z G d� d e� Z G d!� d"e � Z G d#� d$e � Z G d%� d&e� Zy# 1 sw Y ��xY w)'z- Unit tests for L{twisted.python.constants}. � N)�TestCase�ignore)�category)�FlagConstant�Flags� NamedConstant�Names� ValueConstant�Valuesc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �NamedConstantTestszy Tests for the L{twisted.python.constants.NamedConstant} class which is used to represent individual values. c �0 � G d� dt � }|| _ y)zN Create a dummy container into which constants can be placed. c � � e Zd Zy)�%NamedConstantTests.setUp.<locals>.fooN)�__name__� __module__�__qualname__� � �D/usr/lib/python3/dist-packages/twisted/python/test/test_constants.py�foor $ s � �r r N)r � container)�selfr s r �setUpzNamedConstantTests.setUp s � � �%� � ��r c � � t � }|j | j dd� | j d|j � y)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 s r � test_namezNamedConstantTests.test_name) s3 � � ���� � �d�n�n�e�T�2������ � �*r c � � t � }|j | j dd� | j dt |� � y)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 s r �test_representationz&NamedConstantTests.test_representation2 s3 � � ���� � �d�n�n�e�T�2�����d�4�j�1r c � � t � }|j | j dd� | j ||k( � | j ||k7 � y)zG A L{NamedConstant} instance compares equal to itself. r N)r r r � assertTrue�assertFalser s r � test_equalityz NamedConstantTests.test_equality; sA � � ���� � �d�n�n�e�T�2�������%�������&r c �� � t � }|j | j dd� t � }|j | j dd� | j ||k( � | j ||k7 � y)zf Two different L{NamedConstant} instances do not compare equal to each other. r N)r r r r'