File: test_graphics_context_system.py

package info (click to toggle)
python-enable 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,220 kB
  • sloc: cpp: 57,417; python: 28,437; makefile: 314; sh: 43
file content (34 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (2)
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
import unittest

from kiva.agg import GraphicsContextSystem

class GraphicsContextSystemTestCase(unittest.TestCase):

    def test_creation(self):
        """ Simply create and destroy multiple objects.  This silly
            test crashed when we transitioned from Numeric 23.1 to 23.8.
            That problem is fixed now.
        """
        for i in range(10):
            gc = GraphicsContextSystem((100,100), "rgba32")
            del gc

#----------------------------------------------------------------------------
# test setup code.
#----------------------------------------------------------------------------

def check_suite(level=1):
    suites = []
    if level > 0:
        suites.append( unittest.makeSuite(GraphicsContextSystemTestCase,'test_') )
    total_suite = unittest.TestSuite(suites)
    return total_suite

def test(level=10):
    all_tests = check_suite(level)
    runner = unittest.TextTestRunner()
    runner.run(all_tests)
    return runner

if __name__ == "__main__":
    test()