예제 #1
0
 def unmatched_events(self):
     if not self._success:
         return EventContext([
             self.expected_event_type(self.expected_message,
                                      self.matched_state)
         ])
     else:
         return EventContext()
예제 #2
0
 def matched_events(self):
     if self._success:
         if not self.matched_args:
             return EventContext()
         return EventContext([
             self.expected_event_type(self.expected_message,
                                      self.matched_args)
         ])
     else:
         return EventContext()
예제 #3
0
 def matched_events(self):
     if self._success:
         if not self.matched_state:
             return EventContext()
         return EventContext([
             self.expected_event_type(
                 self.expected_message,
                 self.matched_state,
                 ExpectPolicy.check,
             )
         ])
     else:
         return EventContext()
예제 #4
0
 def unmatched_events(self):
     if self.expectation is None:
         return EventContext()
     return self.expectation.unmatched_events()
예제 #5
0
 def matched_events(self):
     if self._no_expect or self.expectation is None:
         return EventContext()
     return self.expectation.matched_events()
예제 #6
0
 def received_events(self):
     if self.expectation is None:
         return EventContext()
     return self.expectation.received_events()
예제 #7
0
 def received_events(self):
     return EventContext()
예제 #8
0
 def expected_events(self):
     return EventContext([
         self.expected_event_type(self.expected_message, self.expected_args)
     ])
예제 #9
0
 def unmatched_events(self):
     if not self._success:
         return EventContext(self.expected_events().events())
     else:
         return EventContext()
예제 #10
0
 def received_events(self):
     if not self._received_events:
         return EventContext()
     return EventContext(self._received_events[:])
예제 #11
0
 def received_events(self):
     if not self:
         return EventContext()
     else:
         return EventContext([self._received_event])
예제 #12
0
 def expected_events(self):
     if self:
         return EventContext()
     else:
         return EventContext([DisconnectedEvent()])