def create_node(self, node_path): """ Create a node at the end of the given path; all but the final node in the path must already exist. """ core.validate_node_path(node_path) existing, new = core.split(node_path) existing_node = self._get_node(existing) existing_node[self._node][new] = {self._node: {}, self._array: {}}
def create_node(self, node_path): existing, new = core.split(node_path) if not new: raise core.MeasurementError("Cannot create root node.") self._get_node(existing).createGroup(new)
def create_node(self, node_path): existing, new = core.split(node_path) if not new: raise core.MeasurementError("Cannot create root node.") os.mkdir(os.path.join(self._get_node(existing), new))
def test_split(): assert core.split('') == ('', '') assert core.split('one') == ('', 'one') assert core.split('/one') == ('/', 'one') assert core.split('one/two/three') == ('one/two', 'three') assert core.split('/one/two/three') == ('/one/two', 'three')