~pygame/pygame/trunk

« back to all changes in this revision

Viewing changes to test/joystick_test.py

  • Committer: pygame
  • Date: 2017-01-10 00:31:42 UTC
  • Revision ID: git-v1:2eea4f299a2e791f884608d7ed601558634af73c
commit 1639c41a8cb3433046882ede92c80ce69d59016b
Author: Thomas Kluyver <takowl@gmail.com>
Date:   Sun Jan 8 18:46:46 2017 +0000

    Build newer versions of libogg and libvorbis into Linux base images

    Closes #317
    Closes #323

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#################################### IMPORTS ###################################
 
2
 
 
3
if __name__ == '__main__':
 
4
    import sys
 
5
    import os
 
6
    pkg_dir = os.path.split(os.path.abspath(__file__))[0]
 
7
    parent_dir, pkg_name = os.path.split(pkg_dir)
 
8
    is_pygame_pkg = (pkg_name == 'tests' and
 
9
                     os.path.split(parent_dir)[1] == 'pygame')
 
10
    if not is_pygame_pkg:
 
11
        sys.path.insert(0, parent_dir)
 
12
else:
 
13
    is_pygame_pkg = __name__.startswith('pygame.tests.')
 
14
 
 
15
import unittest
 
16
 
 
17
################################################################################
 
18
 
 
19
class JoystickTypeTest(unittest.TestCase):
 
20
    def todo_test_Joystick(self):
 
21
 
 
22
        # __doc__ (as of 2008-08-02) for pygame.joystick.Joystick:
 
23
 
 
24
          # pygame.joystick.Joystick(id): return Joystick
 
25
          # create a new Joystick object
 
26
          # 
 
27
          # Create a new joystick to access a physical device. The id argument
 
28
          # must be a value from 0 to pygame.joystick.get_count()-1.
 
29
          # 
 
30
          # To access most of the Joystick methods, you'll need to init() the
 
31
          # Joystick. This is separate from making sure the joystick module is
 
32
          # initialized. When multiple Joysticks objects are created for the
 
33
          # same physical joystick device (i.e., they have the same ID number),
 
34
          # the state and values for those Joystick objects will be shared.
 
35
          # 
 
36
          # The Joystick object allows you to get information about the types of
 
37
          # controls on a joystick device. Once the device is initialized the
 
38
          # Pygame event queue will start receiving events about its input.
 
39
          # 
 
40
          # You can call the Joystick.get_name() and Joystick.get_id() functions
 
41
          # without initializing the Joystick object.
 
42
          # 
 
43
 
 
44
        self.fail() 
 
45
    
 
46
class JoytickModuleTest(unittest.TestCase):
 
47
    def todo_test_get_count(self):
 
48
 
 
49
        # __doc__ (as of 2008-08-02) for pygame.joystick.get_count:
 
50
 
 
51
          # pygame.joystick.get_count(): return count
 
52
          # number of joysticks on the system
 
53
          # 
 
54
          # Return the number of joystick devices on the system. The count will
 
55
          # be 0 if there are no joysticks on the system.
 
56
          # 
 
57
          # When you create Joystick objects using Joystick(id), you pass an
 
58
          # integer that must be lower than this count.
 
59
          # 
 
60
 
 
61
        self.fail() 
 
62
 
 
63
    def todo_test_get_init(self):
 
64
 
 
65
        # __doc__ (as of 2008-08-02) for pygame.joystick.get_init:
 
66
 
 
67
          # pygame.joystick.get_init(): return bool
 
68
          # true if the joystick module is initialized
 
69
          # 
 
70
          # Test if the pygame.joystick.init() function has been called. 
 
71
 
 
72
        self.fail() 
 
73
 
 
74
    def todo_test_init(self):
 
75
 
 
76
        # __doc__ (as of 2008-08-02) for pygame.joystick.init:
 
77
 
 
78
          # pygame.joystick.init(): return None
 
79
          # initialize the joystick module
 
80
          # 
 
81
          # This function is called automatically by pygame.init(). 
 
82
          # It initializes the joystick module. This will scan the system for
 
83
          # all joystick devices. The module must be initialized before any
 
84
          # other functions will work.
 
85
          # 
 
86
          # It is safe to call this function more than once. 
 
87
 
 
88
        self.fail() 
 
89
 
 
90
    def todo_test_quit(self):
 
91
 
 
92
        # __doc__ (as of 2008-08-02) for pygame.joystick.quit:
 
93
 
 
94
          # pygame.joystick.quit(): return None
 
95
          # uninitialize the joystick module
 
96
          # 
 
97
          # Uninitialize the joystick module. After you call this any existing
 
98
          # joystick objects will no longer work.
 
99
          # 
 
100
          # It is safe to call this function more than once. 
 
101
 
 
102
        self.fail() 
 
103
    
 
104
################################################################################
 
105
 
 
106
if __name__ == '__main__':
 
107
    unittest.main()