Skip to content

Commit

Permalink
test: 💍 update moto to use mock_aws
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRDias committed Jan 29, 2024
1 parent e2f9e15 commit d568098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/test_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions tests/utilities/lambda_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d568098

Please sign in to comment.