Beispiel #1
0
 def check(self, received_event):
     if received_event.message.id != self.expected_message.id:
         return self
     self._received_events.append(received_event)
     self.received_args.append(received_event.args)
     for arg_name, arg_val in self.expected_args.items():
         if arg_val is None:
             continue
         if arg_name not in received_event.args:
             return self
         if not equals(received_event.args[arg_name],
                       self.expected_args[arg_name],
                       float_tol=self._float_tol):
             return self
     if not self._success:
         self.matched_args = received_event.args.copy()
         self._success = True
     return self
Beispiel #2
0
 def check(self, received_event, *args, **kwds):
     if not isinstance(received_event, ArsdkMessageEvent):
         return self
     if received_event.message.id != self.expected_message.id:
         return self
     self._received_events.append(received_event)
     self.received_args.append(received_event.args)
     for arg_name, arg_val in self.expected_args.items():
         if arg_val is None:
             continue
         if arg_name not in received_event.args:
             return self
         if not equals(
             received_event.args[arg_name],
             self.expected_args[arg_name],
             float_tol=self._float_tol,
         ):
             return self
     if not self._success:
         self.matched_args = received_event.args.copy()
         self.set_success()
     return self