Exemplo n.º 1
0
 def test_close(self, mock_session):
     mock_session.return_value = None
     stream_cursor = StreamCursor(MOCK_STATEMENT_RESULT, mock_session,
                                  MOCK_TRANSACTION_ID)
     stream_cursor.close()
     self.assertFalse(stream_cursor._is_open)
Exemplo n.º 2
0
    def test_next_when_closed(self, mock_session):
        stream_cursor = StreamCursor(MOCK_STATEMENT_RESULT, mock_session,
                                     MOCK_TRANSACTION_ID)

        stream_cursor.close()
        self.assertRaises(ResultClosedError, next, stream_cursor)