Your IP : 216.73.216.190


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

U

�]��@s�dZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdZej�e�d	��ZGd
d�de�Zdd
�ZdS)z'Base test class for DNS authenticators.�N)�
challenges)�achallenges)�
filesystem)�	acme_util)�utilzexample.comzrsa512_key.pemc@s:eZdZdZejejee	d�Z
dd�Zdd�Zdd�Z
d	S)
�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_keycCs|�t|j��tj��dS�N)Z
assertTrue�
isinstance�authZ	more_info�sixZstring_types��self�r�A/usr/lib/python3/dist-packages/certbot/plugins/dns_test_common.py�test_more_infosz$BaseAuthenticatorTest.test_more_infocCs|�|j�d�tjg�dSr)ZassertEqualr
Zget_chall_prefr�DNS01rrrr�test_get_chall_pref#sz)BaseAuthenticatorTest.test_get_chall_prefcCs.t��}|j�|�|jdttjtjd�dS)Nzpropagation-seconds)�type�default�help)�mockZ	MagicMockr
Zadd_parser_argumentsZassert_any_call�int�ANY)r
�mrrr�test_parser_arguments'sz+BaseAuthenticatorTest.test_parser_argumentsN)�__name__�
__module__�__qualname__�__doc__rZ"KeyAuthorizationAnnotatedChallengerr�DOMAIN�KEYZachallrrrrrrrrs�rc	CsPt��}|D]}||||<qt|d��}|j|d�W5QRXt�|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)Zoutfilei�N)�	configobjZ	ConfigObj�open�writer�chmod)�values�pathZconfig�key�frrrr$0sr$)rr"ZjosepyZjoserrZacmerZcertbotrZcertbot.compatrZ
certbot.testsrrZ	test_utilrZJWKRSA�loadZload_vectorr �objectrr$rrrr�<module>s