
    &h                         S SK r S SKJrJr  S SKrS SKr " S S\ R                  5      r " S S\ R                  5      r " S S\ R                  5      r	\
S	:X  a  \ R                  " 5         gg)
    N)questionpromptc                       \ rS rSrS rSrg)JoystickTypeTest   c                 $    U R                  5         g )N)failselfs    R/var/www/auris/envauris/lib/python3.13/site-packages/pygame/tests/joystick_test.pytodo_test_Joystick#JoystickTypeTest.todo_test_Joystick	   s    . 			     N)__name__
__module____qualname____firstlineno__r   __static_attributes__r   r   r   r   r      s    r   r   c                   ,    \ rS rSrS rS rS rS rSrg)JoystickModuleTest#   c                    S nU R                  [        R                  R                  5       S5        [        R                  R	                  5         U R                  [        R                  R                  5       U" 5       5        [        R                  R                  5         U R                  [        R                  R                  5       U" 5       5        [        R                  R	                  5         [        R                  R	                  5         U R                  [        R                  R                  5       U" 5       5        [        R                  R                  5         U R                  [        R                  R                  5       U" 5       5        [        R                  R                  5         U R                  [        R                  R                  5       U" 5       5        [        S5       H!  n[        R                  R	                  5         M#     U R                  [        R                  R                  5       U" 5       5        [        R                  R                  5         U R                  [        R                  R                  5       U" 5       5        [        S5       H!  n[        R                  R                  5         M#     U R                  [        R                  R                  5       U" 5       5        g )Nc                  v     [         R                  R                  5         g! [         R                   a     gf = f)NFT)pygamejoystick	get_counterrorr   r   r   error_check_get_init>JoystickModuleTest.test_get_init.<locals>.error_check_get_init&   s4    ))+  << s   ! 88Fd   )assertEqualr   r   get_initinitquitrange)r   r   is      r   test_get_init JoystickModuleTest.test_get_init$   s   	 	113U;1135I5KL1135I5KL1135I5KL1135I5KL1135I5KLsAOO  " 1135I5KL1135I5KLsAOO  " 1135I5KLr   c                    [         R                  " 5         [         R                  " 5         U R                  [         R                  R                  5       S5        [         R                  R                  R                  5         [         R                  R                  5         U R                  [         R                  5         [         R                  R                  5         SSS5        Sn[        U5       H!  n[         R                  R                  5         M#     U R                  [         R                  R                  5       S5        U R                  [         R                  R                  5       5        g! , (       d  f       N= f)z
This unit test is for joystick.init()
It was written to help reduce maintenance costs
and to help test against changes to the code or
different platforms.
TN   )r   r%   r$   r"   r   r#   _sdl2
controllerassertRaisesr   r   r&   assertIsNotNone)r   
iterationsr'   s      r   	test_initJoystickModuleTest.test_initH   s     	113T: 	$$&
 	v||,OO%%' -
 
z"AOO  " #113T:V__6689 -,s   >E33
Fc                    [         R                  R                  5         U R                  [         R                  R	                  5       5        [         R                  R                  5         U R                  [         R                  5         [         R                  R	                  5         SSS5        g! , (       d  f       g= f)zTest if joystick.quit works.N)r   r   r$   r/   r   r%   r.   r   r
   s    r   	test_quitJoystickModuleTest.test_quitf   sm     	V__6689v||,OO%%' -,,s   	B11
B?c                 &   [         R                  R                  5          [         R                  R                  5       nU R	                  USS5        [         R                  R                  5         g ! [         R                  R                  5         f = f)Nr   z-joystick.get_count() must return a value >= 0)r   r   r$   r   assertGreaterEqualr%   )r   counts     r   test_get_count!JoystickModuleTest.test_get_countr   sb    	#OO--/E##qM OO  "FOO  "s   1A0 0 Br   N)	r   r   r   r   r(   r1   r4   r9   r   r   r   r   r   r   #   s    "MH:<
(
#r   r   c                        \ rS rSrS/rS rSrg)JoystickInteractiveTest   interactivec                 ,   [        S5        [        R                  R                  5         [        R                  R	                  5       n[        SU S35      nU R                  U5        US:w  ax  [        U5       H"  n[        R                  R                  U5        M$     U R                  [        R                  5         [        R                  R                  U5        S S S 5        [        R                  R                  5         g ! , (       d  f       N-= f)Nz[Please connect any joysticks/controllers now before starting the joystick.get_count() test.zNOTE: Having Steam open may add an extra virtual controller for each joystick/controller physically plugged in.
joystick.get_count() thinks there is [zE] joystick(s)/controller(s)connected to this system. Is this correct?r   )r   r   r   r$   r   r   
assertTruer&   Joystickr.   r   r%   )r   r8   responsexs       r   test_get_count_interactive2JoystickInteractiveTest.test_get_count_interactive   s    )	

 	 ))+55:G <99
 	!
 A:5\((+ """6<<0((/ 1 	 10s   > D
Dr   N)r   r   r   r   __tags__rD   r   r   r   r   r<   r<      s    Hr   r<   __main__)unittestpygame.tests.test_utilsr   r   r   pygame._sdl2.controllerTestCaser   r   r<   r   mainr   r   r   <module>rM      sc     4  x(( 6Y#** Y#x!h// !L zMMO r   