def remove_monitor(nodenet_uid, monitor_uid): """ Delete the given monitor""" try: runtime.remove_monitor(nodenet_uid, monitor_uid) return dict(status='success') except KeyError: return dict(status='error', msg='unknown agent or monitor')
def test_remove_monitor(fixed_nodenet): uid = micropsi.add_slot_monitor(fixed_nodenet, 'n0001', 'gen') assert micropsi.nodenets[fixed_nodenet].get_monitor(uid) is not None micropsi.remove_monitor(fixed_nodenet, uid) gone = False try: micropsi.nodenets[fixed_nodenet].get_monitor(uid) except KeyError: gone = True assert gone
def test_remove_monitor(fixed_nodenet): uid = micropsi.add_gate_monitor(fixed_nodenet, 'n0001', 'gen') assert micropsi.nodenets[fixed_nodenet].get_monitor(uid) is not None micropsi.remove_monitor(fixed_nodenet, uid) monitor = micropsi.nodenets[fixed_nodenet].get_monitor(uid) assert monitor is None
def remove_monitor(nodenet_uid, monitor_uid): try: runtime.remove_monitor(nodenet_uid, monitor_uid) return dict(status='success') except KeyError: return dict(status='error', msg='unknown nodenet or monitor')
def test_remove_monitor(fixed_nodenet): data = micropsi.add_slot_monitor(fixed_nodenet, 'A1', 'gen') assert data['uid'] in micropsi.nodenets[fixed_nodenet].monitors micropsi.remove_monitor(fixed_nodenet, data['uid']) assert data['uid'] not in micropsi.nodenets[fixed_nodenet].monitors