CMS 3D CMS Logo

eventstfile_test.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 import unittest
3 
4 from .eventstfile import Events
5 from PhysicsTools.HeppyCore.utils.testtree import create_tree
6 
7 testfname = 'test_tree.root'
8 
9 class EventsTFileTestCase(unittest.TestCase):
10 
11  def test(self):
12  events = Events(testfname, 'test_tree')
13  event = events.to(2)
14  for iev, ev in enumerate(events):
15  self.assertEqual(iev, ev.var1)
16 
17 if __name__ == '__main__':
18  create_tree(testfname)
19  unittest.main()
def create_tree(filename="test_tree.root")
Definition: testtree.py:6