%PDF- %PDF-
Direktori : /lib/python3/dist-packages/constantly/test/__pycache__/ |
Current File : //lib/python3/dist-packages/constantly/test/__pycache__/test_constants.cpython-312.pyc |
� ?��^� � � � d Z ddlmZmZ ddlmZ ddlmZmZm Z m Z mZmZ G d� de� Z G d� de� Z G d � d ee� Z G d� dee� Z G d � de� 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� de� Z G d� d e � Z G d!� d"e� Zy#)$z Unit tests for L{constantly}. � )�division�absolute_import)�TestCase)� NamedConstant�Names� ValueConstant�Values�FlagConstant�Flagsc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �NamedConstantTestszk Tests for the L{constantly.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__� � �@/usr/lib/python3/dist-packages/constantly/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_representation* 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_equality4 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'