def test_clear_monitor(fixed_nodenet):
    uid = micropsi.add_gate_monitor(fixed_nodenet, 'n0001', 'gen')
    micropsi.step_nodenet(fixed_nodenet)
    micropsi.clear_monitor(fixed_nodenet, uid)
    data = micropsi.get_monitor_data(fixed_nodenet)
    values = data['monitors'][uid]['values']
    assert len(values.keys()) == 0
def test_clear_monitor(fixed_nodenet):
    uid = micropsi.add_gate_monitor(fixed_nodenet, 'n0001', 'gen')
    micropsi.step_nodenet(fixed_nodenet)
    micropsi.clear_monitor(fixed_nodenet, uid)
    data = micropsi.get_monitor_data(fixed_nodenet)
    values = data['monitors'][uid]['values']
    assert len(values.keys()) == 0
def test_clear_monitor(fixed_nodenet):
    monitor = micropsi.add_gate_monitor(fixed_nodenet, 'A1', 'gen')
    micropsi.step_nodenet(fixed_nodenet)
    micropsi.clear_monitor(fixed_nodenet, monitor['uid'])
    data = micropsi.get_monitor_data(fixed_nodenet)
    values = data['monitors'][monitor['uid']]['values']
    assert len(values.keys()) == 0
Example #4
0
def clear_monitor(nodenet_uid, monitor_uid):
    """ Clear the monitor's history """
    try:
        runtime.clear_monitor(nodenet_uid, monitor_uid)
        return dict(status='success')
    except KeyError:
        return dict(status='error', msg='unknown agent or monitor')
Example #5
0
def clear_monitor(nodenet_uid, monitor_uid):
    try:
        runtime.clear_monitor(nodenet_uid, monitor_uid)
        return dict(status='success')
    except KeyError:
        return dict(status='error', msg='unknown nodenet or monitor')