~ubuntu-branches/ubuntu/feisty/pygame/feisty

« back to all changes in this revision

Viewing changes to test/base_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Ed Boraas
  • Date: 2002-02-20 06:39:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020220063924-amlzj7tqkeods4eq
Tags: upstream-1.4
ImportĀ upstreamĀ versionĀ 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
import unittest, pygame
 
3
 
 
4
 
 
5
init_called = quit_called = 0
 
6
def __PYGAMEinit__(): #called automatically by pygame.init()
 
7
    global init_called
 
8
    init_called = init_called + 1
 
9
    pygame.register_quit(pygame_quit)
 
10
def pygame_quit():
 
11
    global quit_called
 
12
    quit_called = quit_called + 1
 
13
 
 
14
 
 
15
 
 
16
class BaseTest(unittest.TestCase):
 
17
    def testAutoInit(self):
 
18
        pygame.init()
 
19
        pygame.quit()
 
20
        self.assertEqual(init_called, 1)
 
21
        self.assertEqual(quit_called, 1)
 
22
 
 
23
 
 
24
 
 
25
if __name__ == '__main__':
 
26
    unittest.main()