Techdebt: Disable some duplicate tests (#7040)

This commit is contained in:
Bert Blommers 2023-11-17 20:10:11 -01:00 committed by GitHub
parent a0876916b9
commit 16dd1d483c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 72 deletions

View File

@ -1,9 +1,10 @@
import json
import pytest
import unittest
from copy import deepcopy
import moto.server as server
from moto import mock_eks
from moto import mock_eks, settings
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
from moto.eks.exceptions import ResourceInUseException, ResourceNotFoundException
from moto.eks.models import (
@ -79,6 +80,8 @@ class TestNodegroup:
@pytest.fixture(autouse=True, name="test_client")
def fixture_test_client():
if settings.TEST_SERVER_MODE:
raise unittest.SkipTest("No point in testing this in ServerMode")
backend = server.create_backend_app(service=SERVICE)
yield backend.test_client()

View File

@ -1,12 +1,18 @@
"""Test the different server responses."""
import json
import re
import pytest
import xmltodict
import unittest
import moto.server as server
from moto import mock_redshift
from moto import mock_redshift, settings
@pytest.fixture(scope="function", autouse=True)
def skip_in_server_mode():
if settings.TEST_SERVER_MODE:
raise unittest.SkipTest("No point in testing this in ServerMode")
@mock_redshift

View File

@ -1,9 +1,10 @@
"""Test different server responses."""
import json
import pytest
import unittest
from uuid import UUID
import pytest
from moto import settings
import moto.server as server
from tests.test_redshiftdata.test_redshiftdata_constants import (
DEFAULT_ENCODING,
@ -13,6 +14,12 @@ from tests.test_redshiftdata.test_redshiftdata_constants import (
CLIENT_ENDPOINT = "/"
@pytest.fixture(scope="function", autouse=True)
def skip_in_server_mode():
if settings.TEST_SERVER_MODE:
raise unittest.SkipTest("No point in testing this in ServerMode")
def headers(action):
return {
"X-Amz-Target": f"RedshiftData.{action}",

View File

@ -3,6 +3,7 @@ import json
import boto3
import pytest
import unittest
import moto.server as server
from moto import mock_secretsmanager, mock_lambda, mock_iam, mock_logs, settings
@ -12,6 +13,12 @@ from tests.test_awslambda.test_lambda import get_test_zip_file1
DEFAULT_SECRET_NAME = "test-secret"
@pytest.fixture(scope="function", autouse=True)
def skip_in_server_mode():
if settings.TEST_SERVER_MODE:
raise unittest.SkipTest("No point in testing this in ServerMode")
@mock_secretsmanager
def test_get_secret_value():
@ -329,11 +336,7 @@ def test_rotate_secret_that_is_still_rotating():
create_secret = test_client.post(
"/",
data={
"Name": DEFAULT_SECRET_NAME,
"SecretString": "foosecret",
# "VersionStages": ["AWSPENDING"],
},
data={"Name": DEFAULT_SECRET_NAME, "SecretString": "foosecret"},
headers={"X-Amz-Target": "secretsmanager.CreateSecret"},
)
create_secret = json.loads(create_secret.data.decode("utf-8"))
@ -450,8 +453,6 @@ def test_rotate_secret_rotation_lambda_arn_too_long():
assert json_data["__type"] == "InvalidParameterException"
if not settings.TEST_SERVER_MODE:
@mock_iam
@mock_lambda
@mock_logs
@ -499,6 +500,7 @@ if not settings.TEST_SERVER_MODE:
logs = logs_conn.describe_log_streams(logGroupName="/aws/lambda/testFunction")
assert len(logs["logStreams"]) == 4
@mock_iam
@mock_lambda
@mock_logs