
    Yf~                     H    d Z ddlmZ ddlmZ  G d dej                  ZdS )z,
Tests for implementations of L{inetdconf}.
    )	inetdconf)unittestc                   *    e Zd ZdZddZddZddZdS )ServicesConfTestsz-
    Tests for L{inetdconf.ServicesConf}
    returnNc                 t   |                                  | _        t          | j        d          5 }|                    d           d d d            n# 1 swxY w Y   |                                  | _        t          | j        d          5 }|                    d           d d d            d S # 1 swxY w Y   d S )Nwz
            # This is a comment
            http            80/tcp          www www-http    # WorldWideWeb HTTP
            http            80/udp          www www-http
            http            80/sctp
            z]
            https           443/tcp                # http protocol over TLS/SSL
            )mktempservicesFilename1openwriteservicesFilename2)selffs     T/var/www/html/env/lib/python3.11/site-packages/twisted/runner/test/test_inetdconf.pysetUpzServicesConfTests.setUp   s3   !%$(#.. 	!GG  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 "&$(#.. 	!GG  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s#   AAA
B--B14B1c                     t          j                    }| j        |_        |                                 |                     |j        dddddddd           dS )z<
        Services are parsed from default filename.
        P   ))httptcp)r   udp)r   sctp)wwwr   )r   r   )www-httpr   )r   r   N)r   ServicesConfr   defaultFilename	parseFileassertEqualservices)r   confs     r   test_parseDefaultFilenamez+ServicesConfTests.test_parseDefaultFilename$   ss     %''#5M!#!#"$ " "%'%' 	
 	
 	
 	
 	
    c                     t          j                    }t          | j                  5 }|                    |           ddd           n# 1 swxY w Y   |                     |j        ddi           dS )z9
        Services are parsed from given C{file}.
        N)httpsr   i  )r   r   r   r   r   r   r   )r   r    r   s      r   test_parseFilez ServicesConfTests.test_parseFile8   s     %''$()) 	QNN1	 	 	 	 	 	 	 	 	 	 	 	 	 	 	M #	
 	
 	
 	
 	
s   A

AA)r   N)__name__
__module____qualname____doc__r   r!   r%    r"   r   r   r      sZ            &
 
 
 
(
 
 
 
 
 
r"   r   N)r)   twisted.runnerr   twisted.trialr   TestCaser   r*   r"   r   <module>r.      sl     % $ $ $ $ $ " " " " " "8
 8
 8
 8
 8
) 8
 8
 8
 8
 8
r"   