File indexing completed on 2024-04-06 12:23:30
0001 from __future__ import absolute_import
0002 import unittest
0003
0004 from .eventstfile import Events
0005 from PhysicsTools.HeppyCore.utils.testtree import create_tree
0006
0007 testfname = 'test_tree.root'
0008
0009 class EventsTFileTestCase(unittest.TestCase):
0010
0011 def test(self):
0012 events = Events(testfname, 'test_tree')
0013 event = events.to(2)
0014 for iev, ev in enumerate(events):
0015 self.assertEqual(iev, ev.var1)
0016
0017 if __name__ == '__main__':
0018 create_tree(testfname)
0019 unittest.main()