1 |
""" |
2 |
Class and functions for testing the Camera class |
3 |
|
4 |
@var __author__: name of author |
5 |
@var __license__: licence agreement |
6 |
@var __copyright__: copyrights |
7 |
@var __url__: url entry point on documentation |
8 |
@var __version__: version |
9 |
@var __date__: date of the version |
10 |
""" |
11 |
|
12 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
13 |
http://www.access.edu.au |
14 |
Primary Business: Queensland, Australia""" |
15 |
__license__="""Licensed under the Open Software License version 3.0 |
16 |
http://www.opensource.org/licenses/osl-3.0.php""" |
17 |
__author__="Paul Cochrane" |
18 |
__url__="http://www.iservo.edu.au/esys" |
19 |
__version__="$Revision$" |
20 |
__date__="$Date$" |
21 |
|
22 |
|
23 |
import unittest |
24 |
import sys,os,string |
25 |
here = os.getcwd() + '/../../' |
26 |
sys.path.append(here) |
27 |
from pyvisi import * # this should import all of the pyvisi stuff needed |
28 |
|
29 |
from ESyS import * |
30 |
import Finley |
31 |
|
32 |
class TestCamera(unittest.TestCase): |
33 |
""" |
34 |
The main test class |
35 |
""" |
36 |
|
37 |
def testAddCamera(self): |
38 |
scene = Scene() |
39 |
camera = scene.addCamera() |
40 |
self.assertEqual(camera.__class__.__name__, 'Camera') |
41 |
|
42 |
def testOnlyOneCamera(self): |
43 |
# there should only be one camera object |
44 |
scene = Scene() |
45 |
camera = scene.addCamera() |
46 |
self.assertEqual(camera._cameraCount,1) |
47 |
self.assertRaises(somekindoferror, scene.addCamera()) |
48 |
|
49 |
if __name__ == '__main__': |
50 |
unittest.main() |
51 |
|
52 |
# vim: expandtab shiftwidth=4: |