diff --git a/src/azul/plugins/metadata/hca/indexer/aggregate.py b/src/azul/plugins/metadata/hca/indexer/aggregate.py index 06ff91527f..9ec34c9f4c 100644 --- a/src/azul/plugins/metadata/hca/indexer/aggregate.py +++ b/src/azul/plugins/metadata/hca/indexer/aggregate.py @@ -49,7 +49,6 @@ class HCAAggregate(Aggregate): @cached_property def cell_count(self) -> int: - cs: JSON return sum(cs['total_estimated_cells'] for cs in self.contents['cell_suspensions'] if cs['total_estimated_cells'] is not None) diff --git a/test/azul_test_case.py b/test/azul_test_case.py index 3818e58e1b..955ebce6e6 100644 --- a/test/azul_test_case.py +++ b/test/azul_test_case.py @@ -147,6 +147,15 @@ class RE(str): 'The \'body\' parameter is deprecated for the \'.*\' API ' 'and will be removed in .*. Instead use .*' ), + 'validate_spec shortcut is deprecated. Use validate instead.', + ( + 'Automatically retrieving remote references can be a security vulnerability and' + ' is discouraged by the JSON Schema specifications. Relying on this behavior is' + ' deprecated and will shortly become an error. If you are sure you want to ' + 'remotely retrieve your reference and that it is safe to do so, you can find ' + 'instructions for doing so via referencing.Registry in the referencing ' + 'documentation (https://referencing.readthedocs.org).' + ) }, UserWarning: { 'https://github.com/DataBiosphere/azul/issues/2114', @@ -210,7 +219,7 @@ def addPatch(self, instance: patch) -> None: # Moto mock's stop() method has the drastic effect of resetting the # model class attributes that are used to track model instances so that # they can later be cleaned up when the backend is reset. - if isinstance(instance, moto.BaseMockAWS): + if isinstance(instance, moto.core.models.MockAWS): cleanup = partial(instance.stop, remove_data=False) else: cleanup = instance.stop diff --git a/test/dynamodb_test_case.py b/test/dynamodb_test_case.py index e7d3bd2885..ee6e90271b 100644 --- a/test/dynamodb_test_case.py +++ b/test/dynamodb_test_case.py @@ -7,7 +7,7 @@ ) from moto import ( - mock_dynamodb, + mock_aws, ) from mypy_boto3_dynamodb import ( DynamoDBClient, @@ -46,7 +46,7 @@ def dynamodb(self) -> DynamoDBClient: def setUp(self): super().setUp() - self.addPatch(mock_dynamodb()) + self.addPatch(mock_aws()) self.dynamodb.create_table(TableName=self._dynamodb_table_name(), BillingMode='PAY_PER_REQUEST', AttributeDefinitions=[ diff --git a/test/health_check_test_case.py b/test/health_check_test_case.py index 7c5e636f0e..7ef0b71b76 100644 --- a/test/health_check_test_case.py +++ b/test/health_check_test_case.py @@ -23,8 +23,7 @@ furl, ) from moto import ( - mock_sqs, - mock_sts, + mock_aws, ) import requests import responses @@ -86,8 +85,7 @@ def test_validation(self): response = requests.get(str(self.base_url.set(path=('health', path)))) self.assertEqual(400, response.status_code) - @mock_sts - @mock_sqs + @mock_aws def test_health_all_ok(self): self._create_mock_queues() with self._mock(): @@ -102,8 +100,7 @@ def test_health_all_ok(self): **self._expected_progress() }, response.json()) - @mock_sts - @mock_sqs + @mock_aws def test_health_endpoint_keys(self): expected = { keys: { @@ -126,8 +123,7 @@ def test_health_endpoint_keys(self): self.assertEqual(200, response.status_code) self.assertEqual(expected_response, response.json()) - @mock_sts - @mock_sqs + @mock_aws def test_cached_health(self): # No health object is available in S3 bucket, yielding an error with self._mock(): @@ -180,8 +176,7 @@ def _expected_health(self, ) -> MutableJSON: raise NotImplementedError - @mock_sts - @mock_sqs + @mock_aws def test_elasticsearch_down(self): self._create_mock_queues() mock_endpoint = ('7c9f2ddb-74ca-46a3-9438-24ce1fe7050e.com', 80) @@ -204,8 +199,7 @@ def _expected_queues(self, *, up: bool) -> MutableJSON: } } if up else { 'up': False, - 'error': 'The specified queue does not exist for' - ' this wsdl version.' + 'error': 'The specified queue does not exist.' } for queue_name in config.all_queue_names }) diff --git a/test/indexer/test_health_check.py b/test/indexer/test_health_check.py index 236df9c498..76ec0d3f89 100644 --- a/test/indexer/test_health_check.py +++ b/test/indexer/test_health_check.py @@ -1,6 +1,5 @@ from moto import ( - mock_sqs, - mock_sts, + mock_aws, ) from azul.logging import ( @@ -39,8 +38,7 @@ def _expected_health(self, **self._expected_progress() } - @mock_sts - @mock_sqs + @mock_aws def test_queues_down(self): with self._mock(): response = self._test('/health/fast') diff --git a/test/indexer/test_indexer_controller.py b/test/indexer/test_indexer_controller.py index 0aea488842..f3bced4cc9 100644 --- a/test/indexer/test_indexer_controller.py +++ b/test/indexer/test_indexer_controller.py @@ -25,8 +25,7 @@ one, ) from moto import ( - mock_sqs, - mock_sts, + mock_aws, ) from azul import ( @@ -76,8 +75,7 @@ def setUpModule(): configure_test_logging(log) -@mock_sts -@mock_sqs +@mock_aws class TestIndexController(DCP1IndexerTestCase, SqsTestCase): partition_prefix_length = 0 diff --git a/test/indexer/test_notifications.py b/test/indexer/test_notifications.py index 0898fb90da..a94734fe44 100644 --- a/test/indexer/test_notifications.py +++ b/test/indexer/test_notifications.py @@ -6,8 +6,7 @@ ) from moto import ( - mock_sqs, - mock_sts, + mock_aws, ) import requests @@ -39,8 +38,7 @@ class TestValidNotificationRequests(LocalAppTestCase, def lambda_name(cls) -> str: return 'indexer' - @mock_sts - @mock_sqs + @mock_aws def test_successful_notifications(self): self._create_mock_notifications_queue() body = { @@ -55,8 +53,7 @@ def test_successful_notifications(self): self.assertEqual(202, response.status_code) self.assertEqual('', response.text) - @mock_sts - @mock_sqs + @mock_aws def test_invalid_notifications(self): bodies = { 'Missing body': {}, @@ -108,8 +105,7 @@ def test_invalid_notifications(self): response = self._test(body, delete, valid_auth=True) self.assertEqual(400, response.status_code) - @mock_sts - @mock_sqs + @mock_aws def test_invalid_auth_for_notification_request(self): self._create_mock_notifications_queue() body = { diff --git a/test/service/__init__.py b/test/service/__init__.py index ee9059be07..5c46bbf31e 100644 --- a/test/service/__init__.py +++ b/test/service/__init__.py @@ -29,8 +29,7 @@ one, ) from moto import ( - mock_s3, - mock_sts, + mock_aws, ) from mypy_boto3_s3.client import ( S3Client, @@ -216,8 +215,7 @@ def _s3(self) -> S3Client: def setUp(self) -> None: super().setUp() - self.addPatch(mock_sts()) - self.addPatch(mock_s3()) + self.addPatch(mock_aws()) def _create_test_bucket(self, bucket_name: str): assert config.region in get_args(BucketLocationConstraintType) diff --git a/test/service/test_app_logging.py b/test/service/test_app_logging.py index 9585bde07f..2cb5bb07f3 100644 --- a/test/service/test_app_logging.py +++ b/test/service/test_app_logging.py @@ -45,7 +45,7 @@ def test_request_logs(self): logs = [(r.levelno, r.getMessage()) for r in logs.records] headers = { 'host': url.netloc, - 'user-agent': 'python-requests/2.32.2', + 'user-agent': 'python-requests/2.32.3', 'accept-encoding': 'gzip, deflate, br', 'accept': '*/*', 'connection': 'keep-alive', diff --git a/test/service/test_health_check.py b/test/service/test_health_check.py index e6434b2395..39f7edc2cc 100644 --- a/test/service/test_health_check.py +++ b/test/service/test_health_check.py @@ -1,6 +1,5 @@ from moto import ( - mock_sqs, - mock_sts, + mock_aws, ) from azul.logging import ( @@ -38,8 +37,7 @@ def _expected_health(self, **self._expected_api_endpoints(up=endpoints_up), } - @mock_sts - @mock_sqs + @mock_aws def test_all_api_endpoints_down(self): self._create_mock_queues() with self._mock(endpoints_up=False): diff --git a/test/service/test_manifest_async.py b/test/service/test_manifest_async.py index e328310a62..ff3cf4b734 100644 --- a/test/service/test_manifest_async.py +++ b/test/service/test_manifest_async.py @@ -23,7 +23,7 @@ furl, ) from moto import ( - mock_sts, + mock_aws, ) import requests import responses @@ -150,7 +150,7 @@ def lambda_name(cls) -> str: execution_id = b'42' - @mock_sts + @mock_aws @mock.patch.object(AsyncManifestService, '_sfn') @mock.patch.object(ManifestService, 'get_manifest') @mock.patch.object(ManifestService, 'get_cached_manifest') diff --git a/test/service/test_source_cache.py b/test/service/test_source_cache.py index f285a56fae..736829ac16 100644 --- a/test/service/test_source_cache.py +++ b/test/service/test_source_cache.py @@ -7,7 +7,7 @@ ) from moto import ( - mock_dynamodb, + mock_aws, ) from mypy_boto3_dynamodb.literals import ( ScalarAttributeTypeType, @@ -23,7 +23,7 @@ ) -@mock_dynamodb +@mock_aws class TestSourceCache(DynamoDBTestCase): def _dynamodb_table_name(self) -> str: diff --git a/test/service/test_version_service.py b/test/service/test_version_service.py index 09b286cb50..95a2b9dff5 100644 --- a/test/service/test_version_service.py +++ b/test/service/test_version_service.py @@ -1,5 +1,5 @@ from moto import ( - mock_dynamodb, + mock_aws, ) from azul.logging import ( @@ -19,7 +19,7 @@ def setUpModule(): configure_test_logging() -@mock_dynamodb +@mock_aws class TestVersionService(VersionTableTestCase): def setUp(self): diff --git a/test/test_app_logging.py b/test/test_app_logging.py index 2372707577..f002e62cba 100644 --- a/test/test_app_logging.py +++ b/test/test_app_logging.py @@ -81,7 +81,7 @@ def fail(): self.assertEqual(len(azul_log.output), 3) headers = { 'host': f'{host}:{port}', - 'user-agent': 'python-requests/2.32.2', + 'user-agent': 'python-requests/2.32.3', 'accept-encoding': 'gzip, deflate, br', 'accept': '*/*', 'connection': 'keep-alive'