CMS 3D CMS Logo

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