File "dns_test_common_lexicon.cpython-36.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/usr/lib/python3.6/site-packages/certbot/plugins/__pycache__/dns_test_common_lexicon.cpython-36.pyc
File size: 7.22 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3

گax
@s0dZddlmZddlmZddlmZddlZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZdd
lmZyddlZWn ek
rddlmZYnXerddlmZneZdZejj ej!dZ"GdddeeZ#GdddeZ$Gdddej%Z&GdddZ'dS)z8Base test class for DNS authenticators built on Lexicon.)Any)
TYPE_CHECKING)	MagicMockN)	HTTPError)RequestException)	Challenge)errors)dns_test_common)
LexiconClient)_AuthenticatorCallableTestCase)util)mock)Protocolzexample.comzrsa512_key.pemc@seZdZUdZeedS)%_AuthenticatorCallableLexiconTestCasezq
    Protocol describing a TestCase suitable to test challenges against
    a mocked LexiconClient instance.
    N)__name__
__module____qualname____doc__rmock_clientrachallrr-/usr/lib/python3.6/dns_test_common_lexicon.pyrs
rc@sFeZdZUdZeee	e
ee
eeeeddddZdS)_LexiconAwareTestCasezX
    Protocol describing a TestCase suitable to test a real LexiconClient instance.
    N)unused_argsreturncGsdS)zl
        See
        https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises
        Nr)selfrrrrassertRaises7sz"_LexiconAwareTestCase.assertRaises)rrrrr
clientr
provider_mockstr
record_prefixrecord_namerecord_content	ExceptionDOMAIN_NOT_FOUND
GENERIC_ERRORLOGIN_ERRORUNKNOWN_LOGIN_ERRORrrrrrrr's
rc@s6eZdZejeeddddZeddddZdS)BaseLexiconAuthenticatorTestN)runused_mock_get_utilityrcCs<|jj|jgtjjtdttjg}|j||j	j
dS)Nz_acme-challenge.)authZperformrr
calladd_txt_recordDOMAINANYassertEqualr
mock_calls)rr)expectedrrrtest_performDsz)BaseLexiconAuthenticatorTest.test_perform)rrcCsDd|j_|jj|jgtjjtdttjg}|j	||j
jdS)NTz_acme-challenge.)r*Z_attempt_cleanupZcleanuprr
r+del_txt_recordr-r.r/rr0)rr1rrrtest_cleanupLsz)BaseLexiconAuthenticatorTest.test_cleanup)	rrr	test_utilZpatch_display_utilrrr2r4rrrrr(Bsr(c@seZdZedZeZedZedZ	dZ
e
deZdZ
eddd	d
ZeddddZeddd
dZeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZedddd Zeddd!d"ZdS)#BaseLexiconClientTestzNo domain foundz400 Client Error: ...z500 Surprise! Error: ...z_acme-challenge.ZbarN)rrcCs0|jjt|j|j|jjjd|j|jddS)NTXT)rtypenamecontent)rr,r-r!r"r
create_recordassert_called_with)rrrrtest_add_txt_record^s
z)BaseLexiconClientTest.test_add_txt_recordcCs@|jdg|jj_|jjt|j|j|jj	j
d|j|jddS)Nr8)r9r:r;)r$rauthenticateside_effectrr,r-r!r"r<r=)rrrr,test_add_txt_record_try_twice_to_find_domaines

zBBaseLexiconClientTest.test_add_txt_record_try_twice_to_find_domaincCs6|j|j|jg|jj_|jtj|jjt	|j
|jdS)N)r$rr@rArrPluginErrorrr,r-r!r")rrrr'test_add_txt_record_fail_to_find_domainnsz=BaseLexiconClientTest.test_add_txt_record_fail_to_find_domaincCs,|j|jj_|jtj|jjt	|j
|jdS)N)r&rr@rArrrCrr,r-r!r")rrrr(test_add_txt_record_fail_to_authenticatewsz>BaseLexiconClientTest.test_add_txt_record_fail_to_authenticatecCs,|j|jj_|jtj|jjt	|j
|jdS)N)r'rr@rArrrCrr,r-r!r")rrrr;test_add_txt_record_fail_to_authenticate_with_unknown_error~szQBaseLexiconClientTest.test_add_txt_record_fail_to_authenticate_with_unknown_errorcCs,|j|jj_|jtj|jjt	|j
|jdS)N)r%rr@rArrrCrr,r-r!r")rrrr(test_add_txt_record_error_finding_domainsz>BaseLexiconClientTest.test_add_txt_record_error_finding_domaincCs,|j|jj_|jtj|jjt	|j
|jdS)N)r%rr<rArrrCrr,r-r!r")rrrr'test_add_txt_record_error_adding_recordsz=BaseLexiconClientTest.test_add_txt_record_error_adding_recordcCs0|jjt|j|j|jjjd|j|jddS)Nr8)r9r:r;)rr3r-r!r"r
delete_recordr=)rrrrtest_del_txt_records
z)BaseLexiconClientTest.test_del_txt_recordcCs.|j|j|jg|jj_|jjt|j|jdS)N)	r$rr@rArr3r-r!r")rrrr'test_del_txt_record_fail_to_find_domainsz=BaseLexiconClientTest.test_del_txt_record_fail_to_find_domaincCs$|j|jj_|jjt|j|jdS)N)	r&rr@rArr3r-r!r")rrrr(test_del_txt_record_fail_to_authenticatesz>BaseLexiconClientTest.test_del_txt_record_fail_to_authenticatecCs$|j|jj_|jjt|j|jdS)N)	r'rr@rArr3r-r!r")rrrr;test_del_txt_record_fail_to_authenticate_with_unknown_errorszQBaseLexiconClientTest.test_del_txt_record_fail_to_authenticate_with_unknown_errorcCs$|j|jj_|jjt|j|jdS)N)	r%rr@rArr3r-r!r")rrrr(test_del_txt_record_error_finding_domainsz>BaseLexiconClientTest.test_del_txt_record_error_finding_domaincCs$|j|jj_|jjt|j|jdS)N)	r%rrIrArr3r-r!r")rrrr)test_del_txt_record_error_deleting_recordsz?BaseLexiconClientTest.test_del_txt_record_error_deleting_record)rrrr#r$rr%rr&r'r r-r!r"rr>rBrDrErFrGrHrJrKrLrMrNrOrrrrr6Ts(		r6)(rZtypingrrZ
unittest.mockrZjosepyZjoseZrequests.exceptionsrrZacme.challengesrZcertbotrZcertbot.pluginsr	Z"certbot.plugins.dns_common_lexiconr
Zcertbot.plugins.dns_test_commonrZ
certbot.testsrr5r
ImportErrorZunittestZtyping_extensionsrobjectr-ZJWKRSAloadZload_vectorZKEYrrZBaseAuthenticatorTestr(r6rrrr<module>s2