%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/names/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_rfc1982.cpython-312.pyc |
� Ϫ�f 6 � �� � d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ G d� dej � Z d � Z eed �� Z G d� d ej � Z eed�� Z G d� dej � Zy)z* Test cases for L{twisted.names.rfc1982}. � N)�datetime)�partial��SerialNumber)�unittestc � � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zy)�SerialNumberTestsz$ Tests for L{SerialNumber}. c �N � | j t d� j d� y)zB L{SerialNumber.serialBits} has default value 32. � � N��assertEqualr �_serialBits��selfs �A/usr/lib/python3/dist-packages/twisted/names/test/test_rfc1982.py�test_serialBitsDefaultz(SerialNumberTests.test_serialBitsDefault s � � ����a��4�4�b�9� c �R � | j t dd�� j d� y)z� L{SerialNumber.__init__} accepts a C{serialBits} argument whose value is assigned to L{SerialNumber.serialBits}. r � �� serialBitsNr r s r �test_serialBitsOverridez)SerialNumberTests.test_serialBitsOverride s! � � ����a�A�6�B�B�A�Fr c �P � | j dt t dd�� � � y)ze L{SerialNumber.__repr__} returns a string containing number and serialBits. z'<SerialNumber number=123 serialBits=32>�{ r r N)r �reprr r s r � test_reprzSerialNumberTests.test_repr# s$ � � ���5���c�b�1�2� r c �L � | j t t d� � d� y)zg L{SerialNumber.__str__} returns a string representation of the current value. r �123N)r �strr r s r �test_strzSerialNumberTests.test_str- s � � ����\�#�.�/��7r c �L � | j t t d� � d� y)zi L{SerialNumber.__int__} returns an integer representation of the current value. r N)r �intr r s r �test_intzSerialNumberTests.test_int4 s � � ����\�#�.�/��5r c �� � | j t t d� � t t d� � � | j t t d� � t t d� � � y)z| L{SerialNumber.__hash__} allows L{SerialNumber} instances to be hashed for use as dictionary keys. r � N)r �hashr �assertNotEqualr s r � test_hashzSerialNumberTests.test_hash; sH � � ����l�1�o�.��\�!�_�0E�F����D��a��1�4��Q��3H�Ir c �z � t dd�� }t dd�� }| j t |j |� y)z� L{SerialNumber._convertOther} raises L{TypeError} if the other SerialNumber instance has a different C{serialBits} value. r r r � N)r �assertRaises� TypeError� _convertOther)r �s1�s2s r �#test_convertOtherSerialBitsMismatchz5SerialNumberTests.test_convertOtherSerialBitsMismatchC s4 � � �!�� *�� �!�� +�����)�R�%5�%5�r�:r c �L � | j t d� t d� � y)zK L{SerialNumber.__eq__} provides rich equality comparison. r N�r r r s r �test_eqzSerialNumberTests.test_eqM s � � ����a��,�q�/�:r c � � | j t d� t � k( � | j t d� j t � � t � y)zy == comparison of L{SerialNumber} with a non-L{SerialNumber} instance returns L{NotImplemented}. r N)�assertFalser �object�assertIs�__eq__�NotImplementedr s r �test_eqForeignTypez$SerialNumberTests.test_eqForeignTypeS s<