~9marusia6/maus/beamlinesimulation

« back to all changes in this revision

Viewing changes to src/map/MapCppSimulation/test_MapCppSimulation.py

  • Committer: justinchristensen at berkeley
  • Date: 2012-06-08 08:47:52 UTC
  • mfrom: (669.1.1 release)
  • Revision ID: justinchristensen@berkeley.edu-20120608084752-5x3f3rzflhhcewwi
new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import unittest
24
24
import os
25
25
import subprocess
26
 
import sys  
27
26
 
28
 
import Configuration
29
27
from MapCppSimulation import MapCppSimulation
30
28
 
31
29
class MapCppSimulationTestCase(unittest.TestCase):
78
76
        self.assertIn("errors", doc)
79
77
        self.assertIn("bad_json_document", doc["errors"])
80
78
 
81
 
 
82
79
    def test_no_mc_branch(self):
83
80
        """Check mapper runs for no mc string, returning an error"""
84
81
        result = self.mapper.process("{}")
120
117
            self.assertIn("final_position", event)
121
118
 
122
119
    def test_visualisation(self):
123
 
        test = os.path.join(os.environ['MAUS_ROOT_DIR'], 'src', 'map',\
 
120
        """ Call test_visualisation """
 
121
        test = os.path.join(os.environ['MAUS_ROOT_DIR'], 'src', 'map', \
124
122
                           'MapCppSimulation', 'run_visualisation_for_tests.py')
125
123
        ps = subprocess.Popen(['python', test])
126
124
        ps.wait()
127
125
        self.assertEqual(ps.returncode, 0, msg='Failed to run visualisation')
128
126
 
 
127
    def test_visualisation_no_event(self):
 
128
        """ Call test_visualisation_no_event """
 
129
        test = os.path.join(os.environ['MAUS_ROOT_DIR'], 'src', 'map', \
 
130
                           'MapCppSimulation', \
 
131
                                      'run_visualisation_vrml2file_no_event.py')
 
132
        ps = subprocess.Popen(['python', test])
 
133
        ps.wait()
 
134
        self.assertEqual(ps.returncode, 0, msg='Failed to run visualisation')
 
135
 
 
136
 
129
137
    configuration = {
130
138
      "verbose_level":2,
131
139
      "simulation_geometry_filename":"Test.dat",