o
    >h	                     @   sJ   d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 G dd dej
ZdS )	z+
Tests for L{twisted.words.xmpproutertap}.
    )internet)unittest)xmpproutertap)	componentc                   @   sR   e Zd ZdddZdddZdddZdd	d
ZdddZdddZdddZ	dS )XMPPRouterTapTestsreturnNc                 C   *   t  }|ddg | |d d dS )z?
        The port option is recognised as a parameter.
        z--port7001portNtapOptionsparseOptionsassertEqualselfopt r   /var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/twisted/words/test/test_xmpproutertap.py	test_port      zXMPPRouterTapTests.test_portc                 C   s&   t  }|g  | |d d dS )z=
        The port option has '5347' as default value
        r
   ztcp:5347:interface=127.0.0.1Nr   r   r   r   r   test_portDefault      
z#XMPPRouterTapTests.test_portDefaultc                 C   r   )zA
        The secret option is recognised as a parameter.
        z--secrethushhushsecretNr   r   r   r   r   test_secret   r   zXMPPRouterTapTests.test_secretc                 C   s&   t  }|g  | |d d dS )zA
        The secret option has 'secret' as default value
        r   Nr   r   r   r   r   test_secretDefault'   r   z%XMPPRouterTapTests.test_secretDefaultc                 C   s&   t  }|dg | |d  dS )z=
        The verbose option is recognised as a flag.
        	--verboseverboseN)r   r   r   
assertTruer   r   r   r   test_verbose/   s   zXMPPRouterTapTests.test_verbosec                 C   s   t  }|g  t |}| |tj | d|jj	 | d|jj
 |j}| |tj | |jtj | d|j | |j dS )zD
        The service gets set up with a router and factory.
        z	127.0.0.1i  r   N)r   r   r   makeServiceassertIsInstancer   StreamServerEndpointServicer   endpoint
_interface_portfactoryr   XMPPComponentServerFactoryrouterRouterr   assertFalse
logTraffic)r   r   sr'   r   r   r   test_makeService7   s   

z#XMPPRouterTapTests.test_makeServicec                 C   s0   t  }|dg t |}| |jj dS )z;
        The verbose flag enables traffic logging.
        r   N)r   r   r   r!   r   r'   r,   )r   r   r-   r   r   r   test_makeServiceVerboseG   s   
z*XMPPRouterTapTests.test_makeServiceVerbose)r   N)
__name__
__module____qualname__r   r   r   r   r    r.   r/   r   r   r   r   r      s    





r   N)__doc__twisted.applicationr   twisted.trialr   twisted.wordsr   r   twisted.words.protocols.jabberr   TestCaser   r   r   r   r   <module>   s   