コード例 #1
0
ファイル: test_client.py プロジェクト: bmuller/silverberg
    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()
コード例 #2
0
    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()