Ejemplo n.º 1
0
 def matched_events(self):
     if not self._deprecated_statedict:
         if self._success:
             if not self.matched_state:
                 return EventContext()
             return EventContext(
                 [
                     ArsdkMessageEvent(
                         self.expected_message,
                         self.matched_state,
                         ExpectPolicy.check,
                     )
                 ]
             )
         else:
             return EventContext()
     else:
         if self._success:
             return {
                 self.expected_message.FULL_NAME: {
                     k.upper(): v for k, v in self.matched_state.items()
                 }
             }
         else:
             return {}
Ejemplo n.º 2
0
 def unmatched_events(self):
     if self._checked:
         return EventContext(
             self._check_expectation.unmatched_events().events())
     else:
         return EventContext(
             self._wait_expectation.unmatched_events().events())
Ejemplo n.º 3
0
 def expected_events(self):
     if self._checked:
         return EventContext(
             self._check_expectation.expected_events().events(),
             ExpectPolicy.check_wait,
         )
     else:
         return EventContext(
             self._wait_expectation.expected_events().events(),
             ExpectPolicy.check_wait,
         )
Ejemplo n.º 4
0
 def unmatched_events(self):
     if not self._deprecated_statedict:
         if not self._success:
             return EventContext(self.expected_events().events())
         else:
             return EventContext()
     else:
         if not self._success:
             return self.expected_events()
         else:
             return {}
Ejemplo n.º 5
0
 def received_events(self):
     if not self._deprecated_statedict:
         if not self._received_events:
             return EventContext()
         return EventContext(self._received_events[:])
     else:
         return {
             self.expected_message.FULL_NAME:
             [{k.upper(): v
               for k, v in args.items()} for args in self.received_args]
         }
Ejemplo n.º 6
0
 def expected_events(self):
     if not self._deprecated_statedict:
         return EventContext(
             [ArsdkMessageEvent(self.expected_message, self.expected_args)])
     else:
         return {
             self.expected_message.FULL_NAME:
             {k.upper(): v
              for k, v in self.expected_args.items()}
         }
Ejemplo n.º 7
0
 def received_events(self):
     return EventContext() if not self._deprecated_statedict else {}