File: joystick_test.py

package info (click to toggle)
pygame 1.9.4.post1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,412 kB
  • sloc: ansic: 54,632; python: 28,791; objc: 334; php: 92; sh: 76; makefile: 36; cpp: 25
file content (107 lines) | stat: -rw-r--r-- 3,849 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#################################### IMPORTS ###################################

if __name__ == '__main__':
    import sys
    import os
    pkg_dir = os.path.split(os.path.abspath(__file__))[0]
    parent_dir, pkg_name = os.path.split(pkg_dir)
    is_pygame_pkg = (pkg_name == 'tests' and
                     os.path.split(parent_dir)[1] == 'pygame')
    if not is_pygame_pkg:
        sys.path.insert(0, parent_dir)
else:
    is_pygame_pkg = __name__.startswith('pygame.tests.')

import unittest

################################################################################

class JoystickTypeTest(unittest.TestCase):
    def todo_test_Joystick(self):

        # __doc__ (as of 2008-08-02) for pygame.joystick.Joystick:

          # pygame.joystick.Joystick(id): return Joystick
          # create a new Joystick object
          # 
          # Create a new joystick to access a physical device. The id argument
          # must be a value from 0 to pygame.joystick.get_count()-1.
          # 
          # To access most of the Joystick methods, you'll need to init() the
          # Joystick. This is separate from making sure the joystick module is
          # initialized. When multiple Joysticks objects are created for the
          # same physical joystick device (i.e., they have the same ID number),
          # the state and values for those Joystick objects will be shared.
          # 
          # The Joystick object allows you to get information about the types of
          # controls on a joystick device. Once the device is initialized the
          # Pygame event queue will start receiving events about its input.
          # 
          # You can call the Joystick.get_name() and Joystick.get_id() functions
          # without initializing the Joystick object.
          # 

        self.fail() 
    
class JoytickModuleTest(unittest.TestCase):
    def todo_test_get_count(self):

        # __doc__ (as of 2008-08-02) for pygame.joystick.get_count:

          # pygame.joystick.get_count(): return count
          # number of joysticks on the system
          # 
          # Return the number of joystick devices on the system. The count will
          # be 0 if there are no joysticks on the system.
          # 
          # When you create Joystick objects using Joystick(id), you pass an
          # integer that must be lower than this count.
          # 

        self.fail() 

    def todo_test_get_init(self):

        # __doc__ (as of 2008-08-02) for pygame.joystick.get_init:

          # pygame.joystick.get_init(): return bool
          # true if the joystick module is initialized
          # 
          # Test if the pygame.joystick.init() function has been called. 

        self.fail() 

    def todo_test_init(self):

        # __doc__ (as of 2008-08-02) for pygame.joystick.init:

          # pygame.joystick.init(): return None
          # initialize the joystick module
          # 
          # This function is called automatically by pygame.init(). 
          # It initializes the joystick module. This will scan the system for
          # all joystick devices. The module must be initialized before any
          # other functions will work.
          # 
          # It is safe to call this function more than once. 

        self.fail() 

    def todo_test_quit(self):

        # __doc__ (as of 2008-08-02) for pygame.joystick.quit:

          # pygame.joystick.quit(): return None
          # uninitialize the joystick module
          # 
          # Uninitialize the joystick module. After you call this any existing
          # joystick objects will no longer work.
          # 
          # It is safe to call this function more than once. 

        self.fail() 
    
################################################################################

if __name__ == '__main__':
    unittest.main()