~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/input/InputCppDAQData/test_InputCppDAQData.py

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with MAUS.  If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
 
"""Tests for MapCppTOFDigits"""
 
16
"""Tests for InputCppDAQData"""
17
17
 
18
18
# pylint: disable = C0103
19
19
 
37
37
                            os.environ.get("MAUS_ROOT_DIR")
38
38
        self._datafile = '02873'
39
39
        self._c = Configuration()
40
 
    def test_init(self):
 
40
        self._mapper = InputCppDAQData()
 
41
    def test_init(self): # pylint: disable = W0201
41
42
        """Check birth with default configuration"""
42
 
        self._mapper = InputCppDAQData(self._datapath, \
43
 
                                       self._datafile)
44
43
        self.assertTrue(self._mapper.birth( self._c.getConfigJSON() ))
45
 
        # Check re-init without closing fails
46
 
        self.assertFalse(self._mapper.birth( self._c.getConfigJSON() ))
47
44
        self.assertTrue(self._mapper.death())
48
45
        return
49
46
 
50
 
    def test_single(self):
51
 
        """Test a single event"""
52
 
        self._mapper = InputCppDAQData(self._datapath, \
53
 
                                       self._datafile)
54
 
        self.assertTrue(self._mapper.birth(self. _c.getConfigJSON() ))
55
 
        # Get a single event and check it's the right size
56
 
        self.assertFalse(self._mapper.readNextEvent())
57
 
        return
58
 
 
59
47
    @classmethod
60
48
    def tearDownClass(self): # pylint: disable = C0103,C0202
61
49
        """Check that we can death() MapCppTOFDigits"""