From ac020c233272204f4e58cb296262d554d5068551 Mon Sep 17 00:00:00 2001 From: Valerie Lambert Date: Thu, 25 Feb 2021 17:43:23 -0800 Subject: [PATCH 1/2] chore: Mark pylint false positive --- src/aws_encryption_sdk/internal/crypto/elliptic_curve.py | 2 +- test/unit/test_streaming_client_encryption_stream.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py b/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py index 47af50b8c..ea7568e24 100644 --- a/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py +++ b/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py @@ -123,7 +123,7 @@ def _ecc_decode_compressed_point(curve, compressed_point): y_order_map = {b"\x02": 0, b"\x03": 1} raw_x = compressed_point[1:] raw_x = to_bytes(raw_x) - x = int_from_bytes(raw_x, "big") + x = int_from_bytes(raw_x, "big") # pylint: disable=not-callable raw_y = compressed_point[0] # In Python3, bytes index calls return int values rather than strings if isinstance(raw_y, six.integer_types): diff --git a/test/unit/test_streaming_client_encryption_stream.py b/test/unit/test_streaming_client_encryption_stream.py index 9b399b6b3..3c5e718c9 100644 --- a/test/unit/test_streaming_client_encryption_stream.py +++ b/test/unit/test_streaming_client_encryption_stream.py @@ -401,7 +401,7 @@ def test_next(self): ) self.mock_source_stream.closed = False mock_stream.readline = MagicMock(return_value=sentinel.line) - test = mock_stream.next() + test = mock_stream.next() # pylint: disable=not-callable mock_stream.readline.assert_called_once_with() assert test is sentinel.line @@ -415,7 +415,7 @@ def test_next_stream_closed(self): mock_stream.close() with pytest.raises(StopIteration): - mock_stream.next() + mock_stream.next() # pylint: disable=not-callable def test_next_source_stream_closed_and_buffer_empty(self): mock_stream = MockEncryptionStream( @@ -428,7 +428,7 @@ def test_next_source_stream_closed_and_buffer_empty(self): mock_stream.output_buffer = b"" with pytest.raises(StopIteration): - mock_stream.next() + mock_stream.next() # pylint: disable=not-callable @patch("aws_encryption_sdk.streaming_client._EncryptionStream.closed", new_callable=PropertyMock) def test_iteration(self, mock_closed): From 0302feca3437adbe6080c66b880995ef69e1ac31 Mon Sep 17 00:00:00 2001 From: Valerie Lambert Date: Thu, 25 Feb 2021 17:59:37 -0800 Subject: [PATCH 2/2] fix lint --- src/aws_encryption_sdk/internal/crypto/elliptic_curve.py | 2 +- test/unit/test_streaming_client_encryption_stream.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py b/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py index ea7568e24..83e6b2def 100644 --- a/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py +++ b/src/aws_encryption_sdk/internal/crypto/elliptic_curve.py @@ -123,7 +123,7 @@ def _ecc_decode_compressed_point(curve, compressed_point): y_order_map = {b"\x02": 0, b"\x03": 1} raw_x = compressed_point[1:] raw_x = to_bytes(raw_x) - x = int_from_bytes(raw_x, "big") # pylint: disable=not-callable + x = int_from_bytes(raw_x, "big") # pylint: disable=not-callable raw_y = compressed_point[0] # In Python3, bytes index calls return int values rather than strings if isinstance(raw_y, six.integer_types): diff --git a/test/unit/test_streaming_client_encryption_stream.py b/test/unit/test_streaming_client_encryption_stream.py index 3c5e718c9..c54455654 100644 --- a/test/unit/test_streaming_client_encryption_stream.py +++ b/test/unit/test_streaming_client_encryption_stream.py @@ -401,7 +401,7 @@ def test_next(self): ) self.mock_source_stream.closed = False mock_stream.readline = MagicMock(return_value=sentinel.line) - test = mock_stream.next() # pylint: disable=not-callable + test = mock_stream.next() # pylint: disable=not-callable mock_stream.readline.assert_called_once_with() assert test is sentinel.line @@ -415,7 +415,7 @@ def test_next_stream_closed(self): mock_stream.close() with pytest.raises(StopIteration): - mock_stream.next() # pylint: disable=not-callable + mock_stream.next() # pylint: disable=not-callable def test_next_source_stream_closed_and_buffer_empty(self): mock_stream = MockEncryptionStream( @@ -428,7 +428,7 @@ def test_next_source_stream_closed_and_buffer_empty(self): mock_stream.output_buffer = b"" with pytest.raises(StopIteration): - mock_stream.next() # pylint: disable=not-callable + mock_stream.next() # pylint: disable=not-callable @patch("aws_encryption_sdk.streaming_client._EncryptionStream.closed", new_callable=PropertyMock) def test_iteration(self, mock_closed):