/[escript]/trunk/pyvisi/test/python/povray/test_renderer.py
ViewVC logotype

Contents of /trunk/pyvisi/test/python/povray/test_renderer.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 601 - (show annotations)
Fri Mar 17 06:18:25 2006 UTC (13 years, 8 months ago) by gross
File MIME type: text/x-python
File size: 2163 byte(s)
directories are moved around to match escript convention
1 # Copyright (C) 2004 Paul Cochrane
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 # $Id: test_renderer.py,v 1.1 2005/01/11 05:10:38 paultcochrane Exp $
18
19 ## @file test_plot.py
20
21 import unittest
22 import sys,os
23 from string import *
24 here = os.getcwd() + '/../../'
25 sys.path.append(here)
26 import pyvisi # this should import all of the pyvisi stuff needed
27
28 """
29 Class and functions for testing the Renderer class
30 """
31
32 class TestRenderer(unittest.TestCase):
33 """
34 The main test class
35 """
36
37 def testRendererExactlyTwoArgs(self):
38 """
39 Tests that the Renderer object is instantiated only with two arguments
40 """
41 # test just the one argument
42 self.assertRaises(TypeError, \
43 pyvisi.Renderer.__init__, 'one')
44 # test three arguments
45 self.assertRaises(TypeError, \
46 pyvisi.Renderer.__init__, 'one', 'two', 'three')
47
48 def testRendererNameType(self):
49 """
50 Tests the type of the renderer name; should be alphanumeric
51 """
52 ren = pyvisi.Renderer()
53 renName = ren.rendererName
54 self.assert_(renName.isalnum(),\
55 msg='Renderer() argument is not alphanumeric')
56
57 def testRendererReturn(self):
58 """
59 Tests that a Renderer() object is returned
60 """
61 ren = pyvisi.Renderer()
62 classStr = ren.__class__.__name__
63 self.assertEqual('Renderer', classStr)
64
65 if __name__ == '__main__':
66 unittest.main()
67
68 # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26