%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/internet/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/internet/test/__pycache__/test_address.cpython-312.pyc |
� Ϫ�fJ � � � d dl Z d dlZd dlmZ d dlmZmZmZmZ d dl m Z d dlmZ d dl mZmZ ej � Z ej$ dZ G d � d � Z G d� de� Z G d � dee� Z G d� dee� Z G d� dee� Z G d� dee� Z eed� G d� de� � Z eed� G d� dee� � Zy# e$ r dZY �~w xY w)� N)�skipIf)�HostnameAddress�IPv4Address�IPv6Address�UNIXAddress)�nativeString)�platform)�SynchronousTestCase�TestCaseFTc �$ � e Zd Zd� Zd� Zd� Zd� Zy)�AddressTestCaseMixinc �� � | j | j � | j � k( � | j | j � | j � k7 � y)a Two different address instances, sharing the same properties are considered equal by C{==} and not considered not equal by C{!=}. Note: When applied via UNIXAddress class, this uses the same filename for both objects being compared. N)� assertTrue�buildAddress�assertFalse��selfs �D/usr/lib/python3/dist-packages/twisted/internet/test/test_address.py�test_addressComparisonz+AddressTestCaseMixin.test_addressComparison sL � � ����)�)�+�t�/@�/@�/B�B�C�����*�*�,��0A�0A�0C�C�D� c �p � | j � }|di}| j || j � � y)z� C{__hash__} can be used to get a hash of an address, allowing addresses to be used as keys in dictionaries, for instance. TN�r r �r �addr�ds r � test_hashzAddressTestCaseMixin.test_hash) �5 � � � � �"�� �4�L������$�+�+�-�.�/r c � � | j | j � | j � k( � | j | j � | j � k( � | j | j � | j � k7 � | j | j � | j � k7 � y)z~ Check that comparison operators work correctly on address objects when a different name is passed in N)r r �buildDifferentAddressr r s r �test_differentNamesComparisonz2AddressTestCaseMixin.test_differentNamesComparison2 s� � � ����*�*�,��0J�0J�0L�L�M�����3�3�5��9J�9J�9L�L�M�����)�)�+�t�/I�/I�/K�K�L�����2�2�4��8I�8I�8K�K�Lr c �� � | j |g� }| j |d d t � | j |d d |� | j t |� d� y)z{ Assert that the a DeprecationWarning with the given message was emitted against the given method. r �category�message� N)� flushWarnings�assertEqual�DeprecationWarning�len)r � testMethodr# �warningss r �assertDeprecationsz'AddressTestCaseMixin.assertDeprecations= s] � � �%�%�z�l�3������!��Z�0�2D�E�����!��Y�/��9�����X���*r N)�__name__� __module__�__qualname__r r r r+ � r r r r s � � E�0� M�+r r c � � e Zd ZdZy)�IPv4AddressTestCaseMixin�)�type�%s)�host�%r��portz%dN)r, r- r. �addressArgSpecr/ r r r1 r1 H s � �E�Nr r1 c � � e Zd ZdZdZd� Zd� Zy)�HostnameAddressTestsz+ Test case for L{HostnameAddress}. ))�hostnamer4 r7 c � � t dd� S )zw Create an arbitrary new L{HostnameAddress} instance. @return: A L{HostnameAddress} instance. s example.comr �r r s r r z!HostnameAddressTests.buildAddressS � � � �~�q�1�1r c � � t dd� S )zw Like L{buildAddress}, but with a different hostname. @return: A L{HostnameAddress} instance. s example.netr r>