o
    Pεi                     @   sF   d Z ddlZddlmZmZ G dd dejZedkr!e  dS dS )zTests for Pronunciation class    N)IPAPronunciationc                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )PronunciationTestCasez"Test cases for Pronunciation classc                 C   s|   d}t j|dd}dd |jD }| |g d dd |D }| |tjdd	d
tjdddtjtjddddddtj	g dS )zTest Pronuncation.from_stringu&   ↗ˈjɛs|ˈt͡ʃuːz#↘aɪpiːeɪ‖F)keep_stressc                 S      g | ]}|j qS  text.0pr   r   L/home/ubuntu/.local/lib/python3.10/site-packages/tests/test_pronunciation.py
<listcomp>       z:PronunciationTestCase.test_from_string.<locals>.<listcomp>)j   ɛs   t͡ʃ   uːza   ɪr      iːer   c                 S   r   r   r   r
   r   r   r   r      r   r   r   r   r   r   r   r   r   r   r   r   N)
r   from_stringphonesassertEqualr   INTONATION_RISINGBREAK_MINOR
BREAK_WORDINTONATION_FALLINGBREAK_MAJORselfpron_strpron
phone_strsr   r   r   test_from_string   s8   z&PronunciationTestCase.test_from_stringc                 C   s    d}t |}| |j| dS )z3Test Pronuncation.from_string with extra diacriticsu   ɔʊ̯N)r   r   r   r	   )r#   r$   r%   r   r   r   test_diacritics/   s   
z%PronunciationTestCase.test_diacriticsc                 C   0   d}t |}dd |D }| |g d dS )z/Test Pronuncation.from_string with tone numbersu   /hwiən˧˨ ziəw˨ˀ˩ʔ/c                 S   r   r   r   r
   r   r   r   r   ;   r   z4PronunciationTestCase.test_tones.<locals>.<listcomp>)	hwi   əu   n˧˨r   r,   r-   u	   w˨ˀ˩ʔNr   r   r   r"   r   r   r   
test_tones6   s   
z PronunciationTestCase.test_tonesc                 C   r)   )z*Test Pronuncation.from_string with accentsu   /²'alːdɑːglɪg/c                 S   r   r   r   r
   r   r   r   r   E   r   z6PronunciationTestCase.test_accents.<locals>.<listcomp>)u   ²'au   lːdu   ɑːglr   r1   Nr.   r"   r   r   r   test_accents@   s   
z"PronunciationTestCase.test_accentsN)__name__
__module____qualname____doc__r'   r(   r/   r3   r   r   r   r   r      s    $
r   __main__)	r7   unittest	gruut_ipar   r   TestCaser   r4   mainr   r   r   r   <module>   s   C