Ë
    õIf�  ã                   ó´   — d dl Z d dlZddlmZmZmZmZmZ  G d„ de j                  «      Z	 G d„ de	«      Z
 G d„ d	e	«      Zed
k(  r e j                  «        yy)é    Né   )ÚPunctuationModeÚCallbackTypeÚ
SSIPClientÚScopeÚSpeakerc                   ó   — e Zd Zd„ Zd„ Zy)Ú_SSIPClientTestc                 ó�   — t        d«      | _        | j                  j                  d«       | j                  j                  d«       y )NÚtestÚené   )r   Ú_clientÚset_languageÚset_rate©Úselfs    ú//usr/lib/python3/dist-packages/speechd/_test.pyÚsetUpz_SSIPClientTest.setUp   s2   € Ü! &Ó)ˆŒØ�‰×!Ñ! $Ô'Ø�‰×Ñ˜bÕ!ó    c                 ó8   — | j                   j                  «        y )N)r   Úcloser   s    r   ÚtearDownz_SSIPClientTest.tearDown   s   € Ø�‰×ÑÕr   N)Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   r
   r
      s   „ ò"ó
r   r
   c                   ó   — e Zd ZdZd„ Zy)ÚAutomaticTestzŸA set of tests which may be evaluated automatically.

    Please put all tests which require a user to listen to their output to the
    VoiceTest below.

    c                 ó¾  ‡— | j                   j                  d«       t        j                  g t        j                  g t        j
                  g iŠ| j                   j                  dˆfd„¬«       | j                   j                  dˆfd„¬«       t        j                  d«       | j                   j                  «        | j                   j                  dˆfd	„¬«       t        j                  d
«       t        j                  t        j                  t        j
                  fD �cg c]  }‰|   ‘Œ	 c}\  }}}|ddgk(  r|dgk(  rd|v rd|v rd|vs	J ‰df«       ‚y c c}w )NÚflitez]This message should get interrupted.  It is hopefully long enough to last more than 1 second.c                 ó,   •— ‰|    j                  d«      S )NÚmsg1©Úappend©ÚtypeÚcalleds    €r   ú<lambda>z.AutomaticTest.test_callbacks.<locals>.<lambda>8   ó   ø€ °¸±×1DÑ1DÀVÓ1L€ r   )Úcallbackz0This second message should not be spoken at all.c                 ó,   •— ‰|    j                  d«      S )NÚmsg2r$   r&   s    €r   r)   z.AutomaticTest.test_callbacks.<locals>.<lambda>:   r*   r   r   zHi.c                 ó,   •— ‰|    j                  d«      S )NÚmsg3r$   r&   s    €r   r)   z.AutomaticTest.test_callbacks.<locals>.<lambda>>   r*   r   é   r#   r/   r-   zæThis failure only indicates a possible error.  The test depends on proper timing and results may warry depending on the used output module and other conditions.  See the code of this test method if you want to investigate further.)
r   Úset_output_moduler   ÚBEGINÚCANCELÚENDÚspeakÚtimeÚsleepÚcancel)r   ÚtÚstartedÚcanceledÚendedr(   s        @r   Útest_callbackszAutomaticTest.test_callbacks)   s\  ø€ ð 	�‰×&Ñ& wÔ/Ü×$Ñ$ bÜ×%Ñ% rÜ×"Ñ" Bð(ˆð 	�‰×Ñð Oã$Lð 	ô 	Nð 	�‰×ÑÐMÛ$Lð 	ô 	Nä�
‰
�1ŒØ�‰×ÑÔØ�‰×Ñ˜5Û$Lð 	ô 	Nô 	�
‰
�1ŒÜ8D×8JÑ8JÜ8D×8KÑ8KÜ8D×8HÑ8Hð8Jö $K°! F¨1£Iò $KÑ ˆ�˜5ð ˜6 6Ð*Ò*¨u¸¸Ò/@Ø˜Ñ! f°Ñ&8Ø˜XÑ%ð	ð ððó	ð &à%ùò$Ks   Ä$EN)r   r   r   Ú__doc__r=   r   r   r   r   r   "   s   „ ñó#r   r   c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)Ú	VoiceTestz•This set of tests requires a user to listen to it.

    The success or failure of the tests defined here can not be detected
    automatically.

    c                 óâ   — | j                   }|j                  d«       |j                  t        j                  «       |j                  d«       |j                  d«       |j                  d«       y )NzTesting data escapes:ú.zMarker at the end.
.
z.
Marker at the beginning.)r   r5   Úset_punctuationr   ÚALL©r   Úcs     r   Útest_escapeszVoiceTest.test_escapesX   sQ   € Ø�L‰LˆØ	�‰Ð'Ô(Ø	×Ñœ/×-Ñ-Ô.Ø	�‰�ŒØ	�‰Ð-Ô.Ø	�‰Ð/Õ0r   c                 ó<  — | j                   }|j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d	«       |j                  d«       |j                  d«       |j	                  d
«       |j                  d«       |j	                  d«       |j                  d«       y )NzTesting voice properties:iœÿÿÿzI am fat Billyéd   zI am slim Willyr   zI am quick Dick.i°ÿÿÿzI am slow Joe.iÎÿÿÿzI am quiet Mariette.zI am noisy Daisy.)r   r5   Ú	set_pitchr   Ú
set_volumerE   s     r   Útest_voice_propertieszVoiceTest.test_voice_properties`   sÎ   € Ø�L‰LˆØ	�‰Ð+Ô,Ø	�‰�DÔØ	�‰Ð Ô!Ø	�‰�CÔØ	�‰Ð!Ô"Ø	�‰�AŒØ	�
‰
�3ŒØ	�‰Ð"Ô#Ø	�
‰
�3ŒØ	�‰Ð Ô!Ø	�
‰
�1ŒØ	�‰�CÔØ	�‰�SÔØ	�‰Ð&Ô'Ø	�‰�SÔØ	�‰Ð#Õ$r   c                 ó¤   — | j                   }|j                  d«       |j                  d«       |j                  d«       |j	                  d«       y )NzTesting other commands:ÚaÚshift_bÚempty)r   r5   ÚcharÚkeyÚ
sound_iconrE   s     r   Útest_other_commandszVoiceTest.test_other_commandss   s;   € Ø�L‰LˆØ	�‰Ð)Ô*Ø	�‰ˆsŒØ	�‰ˆiÔØ	�‰�WÕr   c           	      óÀ  — | j                   }|j                  «       D ]¿  }|j                  |«       t        d|«       |j	                  |dz   «       |j                  «       D ]=  \  }}}t        d||||«       |j                  |«       |j	                  |dz   |z   «       Œ? |j                  d«      D ](  \  }}}t        d||||«       |j                  d«      rŒ(J ‚ ŒÁ y )Nz**zusing default voicez -z using voice Úfr)r   Úlist_output_modulesr1   Úprintr5   Úlist_synthesis_voicesÚset_synthesis_voiceÚ
startswith)r   rF   ÚmoduleÚnameÚlangÚvariants         r   Ú
test_listszVoiceTest.test_listsz   så   € Ø�\‰\ˆØ×-Ñ-Ó/ò 

.ˆVØ× Ñ  Ô(Ü�4˜Ô Ø�W‰W�VÐ2Ñ2Ô3Ø()×(?Ñ(?Ó(Aò 8Ñ$��t˜WÜ�t˜V T¨4°Ô9Ø×&Ñ& tÔ,Ø—‘˜ Ñ0°$Ñ6Õ7ð8ð )*×(?Ñ(?ÀÓ(Eò .Ñ$��t˜WÜ�t˜V T¨4°Ô9ØŸ™¨Õ-Ð-Ð-ñ.ñ

.r   N)r   r   r   r>   rG   rL   rT   r`   r   r   r   r@   r@   P   s   „ ñò1ò%ò&ó.r   r@   Ú__main__)Úunittestr6   Úclientr   r   r   r   r   ÚTestCaser
   r   r@   r   Úmainr   r   r   ú<module>rf      sY   ðó$ Û ç MÕ Mô�h×'Ñ'ô ô*�Oô *ô\6.�ô 6.ðp ˆzÒØ€H‡M�M…Oð r   