HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //usr/lib/python3.9/site-packages/certbot/plugins/__pycache__/dns_test_common.cpython-39.pyc
a

}|�gK
�@s�dZddlmZddlmZddlmZddlmZddlZddlZ	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZddlmZd
Ze	j�e�d��ZGdd�de�ZGdd�d�Zeeefedd�dd�ZdS)z'Base test class for DNS authenticators.�)�Any)�Mapping)�Protocol)�mockN)�
challenges)�achallenges)�
filesystem)�DNSAuthenticator)�	acme_util)�utilzexample.comzrsa512_key.pemc@sJeZdZUdZeed<edd�dd�Zedd�dd�Zedd�d	d
�Z	dS)�_AuthenticatorCallableTestCasezMProtocol describing a TestCase able to call a real DNSAuthenticator instance.�authN)�unused_args�returncGsdS)zj
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue
        N���selfrrr�C/usr/lib/python3.9/site-packages/certbot/plugins/dns_test_common.py�
assertTruesz)_AuthenticatorCallableTestCase.assertTruecGsdS)zk
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertEqual
        Nrrrrr�assertEqualsz*_AuthenticatorCallableTestCase.assertEqualcGsdS)zl
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises
        Nrrrrr�assertRaises%sz+_AuthenticatorCallableTestCase.assertRaises)
�__name__�
__module__�__qualname__�__doc__r	�__annotations__rrrrrrrrr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
    )Zchallb�domainZaccount_keyN)rrcCs|�t|j��t��dS)N)r�
isinstancer
Z	more_info�str�rrrr�test_more_info8sz$BaseAuthenticatorTest.test_more_infocCs|�|j�d�tjg�dS)Nzexample.org)rr
Zget_chall_prefr�DNS01r rrr�test_get_chall_pref;sz)BaseAuthenticatorTest.test_get_chall_prefcCs.t��}|j�|�|jdttjtjd�dS)Nzpropagation-seconds)�type�default�help)rZ	MagicMockr
Zadd_parser_argumentsZassert_any_call�int�ANY)r�mrrr�test_parser_arguments>sz+BaseAuthenticatorTest.test_parser_arguments)rrrrrZ"KeyAuthorizationAnnotatedChallenger
r"�DOMAIN�KEYZachallrr!r#r*rrrrr,s�r)�values�pathrcCsdt��}|D]}||||<qt|d��}|j|d�Wd�n1sJ0Yt�|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.Zconfig�key�frrrr2Es*r2)r�typingrrrZunittestrr0ZjosepyZjoseZacmerZcertbotrZcertbot.compatrZcertbot.plugins.dns_commonr	Z
certbot.testsr
rZ	test_utilr+ZJWKRSA�loadZload_vectorr,rrrr2rrrr�<module>s"