示例#1
0
def test_delete_link(test_nodenet):
    nodes = prepare_nodenet(test_nodenet)
    success, link = micropsi.add_link(test_nodenet, nodes['a'], "por", nodes['b'], "gen", 0.5, 1)
    assert success
    micropsi.delete_link(test_nodenet, nodes['a'], "por", nodes['b'], "gen")
    nodespace = micropsi.get_nodenet_data(test_nodenet, None)
    assert len(nodespace["links"]) == 0
示例#2
0
def test_remove_monitored_link(fixed_nodenet):
    uid = micropsi.add_link_monitor(fixed_nodenet, 'n0005', 'gen', 'n0003',
                                    'gen', 'weight', 'Testmonitor')
    micropsi.delete_link(fixed_nodenet, 'n0005', 'gen', 'n0003', 'gen')
    micropsi.step_nodenet(fixed_nodenet)
    monitor = micropsi.export_monitor_data(fixed_nodenet)
    assert monitor[uid]['values'][1] is None
示例#3
0
def test_delete_link(test_nodenet):
    nodes = prepare_nodenet(test_nodenet)
    success, link = micropsi.add_link(test_nodenet, nodes['a'], "por", nodes['b'], "gen", 0.5, 1)
    assert success
    micropsi.delete_link(test_nodenet, nodes['a'], "por", nodes['b'], "gen")
    nodespace = micropsi.get_nodes(test_nodenet)
    assert nodespace['nodes'][nodes['a']]['links'] == {}
示例#4
0
def delete_link(nodenet_uid, source_node_uid, gate_type, target_node_uid, slot_type):
    return runtime.delete_link(nodenet_uid, source_node_uid, gate_type, target_node_uid, slot_type)
def test_remove_monitored_link(fixed_nodenet):
    uid = micropsi.add_link_monitor(fixed_nodenet, 'n0005', 'gen', 'n0003', 'gen', 'weight', 'Testmonitor')
    micropsi.delete_link(fixed_nodenet, 'n0005', 'gen', 'n0003', 'gen')
    micropsi.step_nodenet(fixed_nodenet)
    monitor = micropsi.export_monitor_data(fixed_nodenet)
    assert monitor[uid]['values'][1] is None
def test_delete_link(test_nodenet):
    micropsi.delete_link(test_nodenet, "ret_cb")
    nodespace = micropsi.get_nodespace(test_nodenet, "Root", -1)
    assert len(nodespace["links"]) == 1
    assert "ret_cb" not in nodespace["links"]
示例#7
0
def delete_link(nodenet_uid, link_uid):
    return runtime.delete_link(nodenet_uid, link_uid)
示例#8
0
def test_delete_link(test_nodenet):
    success, link = micropsi.add_link(test_nodenet, "node_a", "por", "node_b", "gen", 0.5, 1)

    micropsi.delete_link(test_nodenet, "node_a", "por", "node_b", "gen")
    nodespace = micropsi.get_nodespace(test_nodenet, "Root", -1)
    assert len(nodespace["links"]) == 1
示例#9
0
def delete_link(nodenet_uid, source_node_uid, gate_type, target_node_uid, slot_type):
    """ Delete the given link"""
    return runtime.delete_link(nodenet_uid, source_node_uid, gate_type, target_node_uid, slot_type)