def test_pause(self): """ When pausing, stop reading and stop writing on the transport are called if the transport exists. """ client = TestingCQLClient(self.endpoint, 'meh') client.pause() self.assertEqual(len(self.twisted_transport.stopReading.mock_calls), 0) self.assertEqual(len(self.twisted_transport.stopWriting.mock_calls), 0) self.assertFired(client.describe_version()) client.pause() self.twisted_transport.stopReading.assert_called_one_with() self.twisted_transport.stopWriting.assert_called_one_with()
def test_pause(self): """ When pausing, stop reading and stop writing on the transport are called if the transport exists. """ client = TestingCQLClient(self.endpoint, 'meh') client.pause() self.assertEqual(len(self.twisted_transport.stopReading.mock_calls), 0) self.assertEqual(len(self.twisted_transport.stopWriting.mock_calls), 0) self.assertFired(client.describe_version()) client.pause() self.twisted_transport.stopReading.assert_called_one_with() self.twisted_transport.stopWriting.assert_called_one_with()