o
    DDi                     @   sP   d dl mZ d dlmZ d dlZd dlmZ d dlm	Z	m
Z
 G dd de
ZdS )    )dedent)OptionalN)ensure_type)data_providerUnitTestc                   @   s|   e Zd Zeddedee ddfddZeddedee ddfd	d
Zeddedee ddfddZdddZ	dS )DocstringTest)) N)z""r   )z# comment is not docstringN)z]
                # comment
                """docstring in triple quotes."""
                zdocstring in triple quotes.)z"docstring in single quotes."zdocstring in single quotes.)zg
                # comment
                """docstring in """ "concatenated strings."
                z"docstring in concatenated strings.code	docstringreturnNc                 C   s   |  tt| | d S NassertEqualcstparse_moduler   get_docstringselfr	   r
    r   [/var/www/Datamplify/venv/lib/python3.10/site-packages/libcst/_nodes/tests/test_docstring.pytest_module_docstring   s   z#DocstringTest.test_module_docstring))zO
                def f():  # comment"
                    pass
                N)zdef f():"docstring"r
   )z
                def f():
                    """
                    This function has no input
                    and always returns None.
                    """
                z3This function has no input
and always returns None.)z
            def fn():  # comment 1
                # comment 2
                
                
                
                "docstring"
            r
   )zM
                def fn():
                    ("docstring")
                r
   c                 C   &   |  ttt|tj | d S r   )r   r   r   parse_statementr   FunctionDefr   r   r   r   r   test_function_docstring,   s   )z%DocstringTest.test_function_docstring))zO
                class C:  # comment"
                    pass
                N)zclass C(Base):"docstring"r
   )z
                class C(Base):
                    # a comment
                    
                    """
                    This class has a multi-
                    line docstring.
                    """
                z'This class has a multi-
line docstring.)zm
            class C(A, B):  # comment 1
                # comment 2
                "docstring"
            r
   c                 C   r   r   )r   r   r   r   r   ClassDefr   r   r   r   r   test_class_docstring\   s   !z"DocstringTest.test_class_docstringc                 C   s@   d}|  tt| d |  tt|jddd d S )Nz
               """   A docstring with indentation one first line
                 and the second line.
               """
               z@A docstring with indentation one first line
and the second line.F)cleanzF   A docstring with indentation one first line
  and the second line.
r   )r   r	   r   r   r   test_clean_docstring   s   z"DocstringTest.test_clean_docstring)r   N)
__name__
__module____qualname__r   strr   r   r   r   r   r   r   r   r   r      s    ( r   )textwrapr   typingr   libcstr   libcst.helpersr   libcst.testing.utilsr   r   r   r   r   r   r   <module>   s   