From 074a5a4a429ae8c3a8ea1ba30a546676e9d7b22a Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Thu, 17 Dec 2020 14:24:20 +0100
Subject: [PATCH] Add test for arrays()

---
 tests/test_offline.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/test_offline.py b/tests/test_offline.py
index 9c11402..c9fd88f 100644
--- a/tests/test_offline.py
+++ b/tests/test_offline.py
@@ -459,6 +459,16 @@ class TestBranchIndexingMagic(unittest.TestCase):
         self.assertEqual(3, len(self.events[ak.Array([0, 2, 3])]))
 
 
+class TestBranchHighLevelAccessor(unittest.TestCase):
+    def test_tracks_arrays(self):
+        pos_xy = OFFLINE_FILE.tracks.arrays(["pos_x", "pos_y"])
+        n = len(pos_xy)
+        for i in range(n):
+            assert np.allclose(
+                OFFLINE_FILE.tracks.pos_x.tolist()[i], pos_xy.pos_x.tolist()[i]
+            )
+
+
 class TestUsr(unittest.TestCase):
     def setUp(self):
         self.f = OFFLINE_USR
-- 
GitLab