Exemple #1
0
 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: {}}
Exemple #2
0
 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)
Exemple #3
0
 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))
Exemple #4
0
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')
Exemple #5
0
 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)
Exemple #6
0
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')
Exemple #7
0
 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))