a }|g @ s d Z ddlZddlZddlmZ ddlZddlmZ ddlmZ ddl m Z G dd dejZG d d d ejZ edkreeejdd eg dS ) zTests for certbot.errors. N)mock)messages)achallenges) acme_utilc @ s( e Zd ZdZdd Zdd Zdd ZdS ) FailedChallengesTestz*Tests for certbot.errors.FailedChallenges.c C s@ ddl m} |tjdtjtjd tjj dddddh| _ d S ) Nr FailedChallengesexample.comtlsdetailr ZchallZurierrordomainZchallb)certbot.errorsr r DNSr ChallengeBodyr DNS01Error with_coder )selfr r G/usr/lib/python3.9/site-packages/certbot/_internal/tests/errors_test.pysetUp s zFailedChallengesTest.setUpc C s t | jdsJ d S )NTFailed authorization procedure. example.com (dns-01): urn:ietf:params:acme:error:tlsstrr startswithr r r r test_str s zFailedChallengesTest.test_strc C sT ddl m} d}|tjdtjtjd tjj d|dddh}t |d sPJ d S ) Nr r u عدالةr r r r r r )r r r r r r r r r r r r )r r Z arabic_detailZarabic_errorr r r test_unicode s z!FailedChallengesTest.test_unicodeN)__name__ __module____qualname____doc__r r r! r r r r r s r c @ s( e Zd ZdZdd Zdd Zdd ZdS ) StandaloneBindErrorTestz-Tests for certbot.errors.StandaloneBindError.c C s ddl m} |tjjd| _d S )Nr )StandaloneBindError )r r' r sentinelr )r r' r r r r , s zStandaloneBindErrorTest.setUpc C s( t jj| jjksJ d| jjks$J d S )Nr( )r r) r Zsocket_errorportr r r r test_instance_args0 s z*StandaloneBindErrorTest.test_instance_argsc C s t | jdsJ d S )NzProblem binding to port 1234: r r r r r r 4 s z StandaloneBindErrorTest.test_strN)r" r# r$ r% r r+ r r r r r r&