%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/certbot/plugins/__pycache__/dns_test_common.cpython-312.pyc

�

M/�eK
��2�dZddlmZddlmZddlmZddlmZddlZddlZ	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZddlmZd
Ze	j.j1ej2d��ZGd�de�ZGd�d�Zdeeefdeddfd�Zy)z'Base test class for DNS authenticators.�)�Any)�Mapping)�Protocol)�mockN)�
challenges)�achallenges)�
filesystem)�DNSAuthenticator)�	acme_util)�utilzexample.comzrsa512_key.pemc�L�eZdZUdZeed<deddfd�Zdeddfd�Zdeddfd�Z	y)	�_AuthenticatorCallableTestCasezMProtocol describing a TestCase able to call a real DNSAuthenticator instance.�auth�unused_args�returnNc��y)zj
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue
        N���selfrs  �A/usr/lib/python3/dist-packages/certbot/plugins/dns_test_common.py�
assertTruez)_AuthenticatorCallableTestCase.assertTrue���c��y)zk
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertEqual
        Nrrs  r�assertEqualz*_AuthenticatorCallableTestCase.assertEqualrrc��y)zl
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises
        Nrrs  r�assertRaisesz+_AuthenticatorCallableTestCase.assertRaises%rr)
�__name__�
__module__�__qualname__�__doc__r
�__annotations__rrrrrrrrrsD��W�
���s��t�����������rrc�~�eZdZdZej
ejee	��Z
deddfd�Zdeddfd�Z
deddfd�Zy)	�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
    )�challb�domain�account_keyrrNc�r�|jt|jj�t��y)N)r�
isinstancer�	more_info�str�rs r�test_more_infoz$BaseAuthenticatorTest.test_more_info8s"�����
�4�9�9�#6�#6�#8�#�>�?rc�x�|j|jjd�tjg�y)Nzexample.org)rr�get_chall_prefr�DNS01r,s r�test_get_chall_prefz)BaseAuthenticatorTest.test_get_chall_pref;s*��������1�1�-�@�:�CS�CS�BT�Urc���tj�}|jj|�|j	dt
tjtj��y)Nzpropagation-seconds)�type�default�help)r�	MagicMockr�add_parser_arguments�assert_any_call�int�ANY)r�ms  r�test_parser_argumentsz+BaseAuthenticatorTest.test_parser_arguments>sC���N�N����	�	�&�&�q�)�	���/�c�4�8�8�RV�RZ�RZ��[r)rrr r!r�"KeyAuthorizationAnnotatedChallengerr0�DOMAIN�KEY�achallrr-r1r<rrrr$r$,sl���<�[�
;�
;����v�3�@�F�@�;�@��@�V�"@�V�T�V�\�$B�\�t�\rr$�values�pathrc���tj�}|D]
}||||<�t|d�5}|j|��ddd�t	j
|d�y#1swY� xYw)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)�outfileNi�)�	configobj�	ConfigObj�open�writer	�chmod)rArB�config�key�fs     rrIrIEsq���
 �
 �
"�F��"���S�k��s��"�
�d�D�	� �Q����Q��� ����T�5�!� � �s�A"�"A+)r!�typingrrr�unittestrrF�josepy�jose�acmer�certbotr�certbot.compatr	�certbot.plugins.dns_commonr
�
certbot.testsrr�	test_utilr>�JWKRSA�load�load_vectorr?rr$r+rIrrr�<module>r[s���-���������%�7�#�+�	��
�k�k���,�y�,�,�-=�>�?���X��.\�\�2"�'�#�s�(�#�"�3�"�4�"r

Zerion Mini Shell 1.0