a
    
d6
                     @   s^   d Z ddlZddlZddlmZ ddlmZ ddlmZ G dd dejZ	e
dkrZe  dS )	zTests for yapf.line_joiner.    N)line_joiner)style)yapf_test_helperc                   @   sP   e Zd Zedd Zdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dd ZdS )LineJoinerTestc                 C   s   t t   d S )N)r   ZSetGlobalStyleZCreatePEP8Style)cls r   c/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/yapftests/line_joiner_test.py
setUpClass   s    zLineJoinerTest.setUpClassc                 C   s    t |}| t|| dS )zCheck that the given LogicalLines are joined as expected.

    Arguments:
      code: The code to check to see if we can join it.
      join_lines: True if we expect the lines to be joined.
    N)r   ZParseAndUnwrapZassertCodeEqualr   ZCanMergeMultipleLines)selfcode
join_linesZllinesr   r   r   _CheckLineJoining   s    
z LineJoinerTest._CheckLineJoiningc                 C   s   t d}| j|dd d S )Nz0        if isinstance(a, int): continue
        Tr   textwrapdedentr   r
   r   r   r   r   testSimpleSingleLineStatement)   s    
z,LineJoinerTest.testSimpleSingleLineStatementc                 C   s   t d}| j|dd d S )Nz<        if isinstance(b, int):
            continue
        Fr   r   r   r   r   r   testSimpleMultipleLineStatement/   s    
z.LineJoinerTest.testSimpleMultipleLineStatementc                 C   s   t d}| j|dd d S )NzX        if isinstance(c, int):
            while True:
                continue
        Fr   r   r   r   r   r   &testSimpleMultipleLineComplexStatement6   s    
z5LineJoinerTest.testSimpleMultipleLineComplexStatementc                 C   s   t d}| j|dd d S )NzR        if isinstance(d, int): continue  # We're pleased that d's an int.
        Tr   r   r   r   r   r   *testSimpleMultipleLineStatementWithComment>   s    
z9LineJoinerTest.testSimpleMultipleLineStatementWithCommentc                 C   s   t d}| j|dd d S )Nz3        if isinstance(e, int):    continue
        Tr   r   r   r   r   r   .testSimpleMultipleLineStatementWithLargeIndentD   s    
z=LineJoinerTest.testSimpleMultipleLineStatementWithLargeIndentc                 C   s   t d}| j|dd d S )Nzp        if instance(bbbbbbbbbbbbbbbbbbbbbbbbb, int): cccccccccccccccccccccccccc = ddddddddddddddddddddd
        Fr   r   r   r   r   r   testOverColumnLimitJ   s    
z"LineJoinerTest.testOverColumnLimitN)__name__
__module____qualname__classmethodr	   r   r   r   r   r   r   r   r   r   r   r   r      s   

r   __main__)__doc__r   ZunittestZyapf.yapflibr   r   Z	yapftestsr   ZYAPFTestr   r   mainr   r   r   r   <module>   s   8