def test_lock_rpc(self): lock_rpc = ietf_netconf.Lock() lock_rpc.input.target.candidate = Empty() reply = self.es.execute_rpc(self.ncc, lock_rpc) self.assertIsNone(reply) unlock_rpc = ietf_netconf.Unlock() unlock_rpc.input.target.candidate = Empty() reply = self.es.execute_rpc(self.ncc, unlock_rpc) self.assertIsNone(reply)
def test_unlock_rpc_fail(self): lock_rpc = ietf_netconf.Lock() lock_rpc.input.target.candidate = Empty() reply = self.es.execute_rpc(self.ncc, lock_rpc) self.assertIsNone(reply) unlock_rpc = ietf_netconf.Unlock() unlock_rpc.input.target.running = Empty() try: reply = self.es.execute_rpc(self.ncc, unlock_rpc) except Exception as e: self.assertIsInstance(e, YError)