From d568098305b5bdab4dc0ead8512d7f97f9a67295 Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Mon, 29 Jan 2024 15:49:43 +0100 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20moto=20to=20use?= =?UTF-8?q?=20mock=5Faws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_lambda.py | 7 ++++--- tests/utilities/lambda_util.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_lambda.py b/tests/test_lambda.py index 6d0c5a5..c77fb3a 100644 --- a/tests/test_lambda.py +++ b/tests/test_lambda.py @@ -10,9 +10,10 @@ import ldap3 import mock import pytest -from moto import mock_lambda, mock_secretsmanager +from moto import mock_aws from src import lambda_function + from .utilities import lambda_util from .utilities.ldap_test import LdapServer @@ -107,13 +108,13 @@ def ldap_config(ldap_server, lambda_env): @pytest.fixture(scope="function") def secretsmanager(aws_credentials): - with mock_secretsmanager(): + with mock_aws(): yield boto3.client("secretsmanager", region_name=_region) @pytest.fixture(scope="function") def lambda_conn(aws_credentials): - with mock_lambda(): + with mock_aws(): yield boto3.client("lambda", region_name=_region) diff --git a/tests/utilities/lambda_util.py b/tests/utilities/lambda_util.py index f32235f..f158f7f 100644 --- a/tests/utilities/lambda_util.py +++ b/tests/utilities/lambda_util.py @@ -6,13 +6,13 @@ import boto3 from botocore.exceptions import ClientError -from moto import mock_iam +from moto import mock_aws _lambda_region = "eu-central-1" def get_role_name(): - with mock_iam(): + with mock_aws(): iam = boto3.client("iam", region_name=_lambda_region) while True: try: