HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/certbot/plugins/__pycache__/dns_test_common.cpython-36.pyc
3

گac
�@sdZddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZer�ddlmZneZyddlZWn ek
r�dd
lmZYnXdZejjejd��ZGdd�de�ZGdd�d�Z ee!efe!dd�dd�Z"dS)z'Base test class for DNS authenticators.�)�Any)�Mapping)�
TYPE_CHECKINGN)�
challenges)�achallenges)�
filesystem)�DNSAuthenticator)�	acme_util)�util)�Protocol)�mockzexample.comzrsa512_key.pemc@s6eZdZUdZeedd�dd�Zedd�dd�ZdS)�_AuthenticatorCallableTestCasezMProtocol describing a TestCase able to call a real DNSAuthenticator instance.N)�unused_args�returncGsdS)zj
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue
        N�)�selfrrr�%/usr/lib/python3.6/dns_test_common.py�
assertTrue$sz)_AuthenticatorCallableTestCase.assertTruecGsdS)zk
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertEqual
        Nr)rrrrr�assertEqual+sz*_AuthenticatorCallableTestCase.assertEqual)	�__name__�
__module__�__qualname__�__doc__r�authrrrrrrrr
 s
r
c@sReZdZdZejejee	d�Z
edd�dd�Zedd�dd�Z
edd�d	d
�ZdS)�BaseAuthenticatorTestz�
    A base test class to reduce duplication between test code for DNS Authenticator Plugins.

    Assumes:
     * That subclasses also subclass unittest.TestCase
     * That the authenticator is stored as self.auth
    )ZchallbZdomainZaccount_keyN)rrcCs|jt|jj�t��dS)N)r�
isinstancerZ	more_info�str)rrrr�test_more_info?sz$BaseAuthenticatorTest.test_more_infocCs|j|jjd�tjg�dS)Nzexample.org)rrZget_chall_prefr�DNS01)rrrr�test_get_chall_prefBsz)BaseAuthenticatorTest.test_get_chall_prefcCs.tj�}|jj|�|jdttjtjd�dS)Nzpropagation-seconds)�type�default�help)rZ	MagicMockrZadd_parser_argumentsZassert_any_call�int�ANY)r�mrrr�test_parser_argumentsEsz+BaseAuthenticatorTest.test_parser_arguments)rrrrrZ"KeyAuthorizationAnnotatedChallenger	r�DOMAIN�KEYZachallr
rrr&rrrrr3sr)�values�pathrc
CsTtj�}x|D]}||||<qWt|d��}|j|d�WdQRXtj|d�dS)z�Write the specified values to a config file.

    :param dict values: A map of values to write.
    :param str path: Where to write the values.
    �wb)ZoutfileNi�)�	configobjZ	ConfigObj�open�writer�chmod)r)r*�config�key�frrrr.Ls
r.)#rZtypingrrrr,ZjosepyZjoseZacmerZcertbotrZcertbot.compatrZcertbot.plugins.dns_commonrZ
certbot.testsr	r
Z	test_utilZtyping_extensionsr�objectr�ImportErrorZunittestr'ZJWKRSA�loadZload_vectorr(r
rrr.rrrr�<module>s.