def test_swim_client_command_before_open(self):
     # Given
     swim_client = SwimClient()
     # When
     downlink_event = swim_client.downlink_event()
     # Then
     self.assertIsInstance(downlink_event, _EventDownlinkView)
     self.assertEqual(downlink_event._client, swim_client)
 def test_swim_client_downlink_event_open_before_client_started(self, mock_warn):
     # Given
     swim_client = SwimClient()
     # When
     downlink_event = swim_client.downlink_event()
     downlink_event.open()
     # Then
     self.assertEqual('Cannot execute "_add_downlink_view" before the client has been started!',
                      mock_warn.call_args_list[0][0][0])