~mice-lcr/maus/end-of-emr-run

« back to all changes in this revision

Viewing changes to src/map/MapCppTOFSlabHits/test_MapCppTOFSlabHits.py

First working version of the TOF reconstruction

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import json
 
3
import unittest
 
4
from Configuration import Configuration
 
5
import MAUS
 
6
 
 
7
from MapCppTOFSlabHits import MapCppTOFSlabHits
 
8
 
 
9
class MapCppTOFSlabHitsTestCase(unittest.TestCase):
 
10
    @classmethod
 
11
    def setUpClass(self):
 
12
        self.mapper = MAUS.MapCppTOFSlabHits()
 
13
        self.c = Configuration()
 
14
 
 
15
    def test_empty(self):
 
16
        success = self.mapper.birth(self. c.getConfigJSON())
 
17
        self.assertTrue(success)
 
18
        result = self.mapper.process("")
 
19
        doc = json.loads(result)
 
20
        self.assertTrue("errors" in doc)
 
21
        self.assertTrue("bad_json_document" in doc["errors"])
 
22
 
 
23
    @classmethod
 
24
    def tearDownClass(self):
 
25
        success = self.mapper.death()
 
26
        if not success:
 
27
            raise Exception('InitializeFail', 'Could not start worker')
 
28
        self.mapper = None
 
29
 
 
30
if __name__ == '__main__':
 
31
    unittest.main()
 
 
b'\\ No newline at end of file'