Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_cache.cpython-312.pyc |
�
Ϫ�f� � �r � d Z ddlZddlmZ ddlmZmZ ddlmZm Z ddl
mZ G d� dej � Z
y) z#
Tests for L{twisted.names.cache}.
� N)�verifyClass)�
interfaces�task)�cache�dns)�unittestc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �CachingTestsz+
Tests for L{cache.CacheResolver}.
c �T � t t j t j � y)zK
L{cache.CacheResolver} implements L{interfaces.IResolver}
N)r r � IResolverr �
CacheResolver)�selfs �?/usr/lib/python3/dist-packages/twisted/names/test/test_cache.py�test_interfacezCachingTests.test_interface s � � �J�(�(�%�*=�*=�>� c � � t j t j dt j t j
�� t
j � g g g ffi� }|j d� j | j g g g f� S )N� example.com��name�type�cls)
r r
r �Query�MX�IN�time�lookupMailExchange�addCallback�assertEqual)r �cs r �test_lookupzCachingTests.test_lookup sx � ����� � �~�C�F�F����G��I�I�K���R�L�J�
�
�� �#�#�N�3�?�?����r�2�r�l�
�
r c �V � t j dt j t j dt j dd� � gt j dt j t j dt j dd� � gt j dt j t j dt j dd� � gf}t j � }t j dt j t j �� }t j ||j � |fi|�� }|j d� | j ||j � | j |j d� t j � S )z�
Cache entries passed into L{cache.CacheResolver.__init__} get
cancelled just like entries added with cacheResult
r �<