def test_back(self): str_path = "file.nxs://:NXentry/:NXinstrument/data@units" p = make_path(str_path) data = p.back self.assertEqual(data["base_class"],"") self.assertEqual(data["name"],"data") self.assertTrue(has_name(data)) self.assertTrue(not has_class(data))
def test_front(self): str_path = "file.nxs://:NXentry/:NXinstrument/data@units" p = make_path(str_path) root = p.front self.assertEqual(root["base_class"],"NXroot") self.assertEqual(root["name"],"/") self.assertTrue(has_name(p.front)) self.assertTrue(has_class(p.front))
from __future__ import print_function from pni.io.nx import nxpath from pni.io.nx import make_path from pni.io.nx import is_root_element from pni.io.nx import has_class from pni.io.nx import has_name p = make_path("/:NXentry") entry = p.back print(entry) print(has_class(entry)) print(entry) print(has_name(entry)) print(entry)