Techdebt: Disable some duplicate tests (#7040)
This commit is contained in:
parent
a0876916b9
commit
16dd1d483c
@ -1,9 +1,10 @@
|
|||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
|
import unittest
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import moto.server as server
|
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.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
||||||
from moto.eks.exceptions import ResourceInUseException, ResourceNotFoundException
|
from moto.eks.exceptions import ResourceInUseException, ResourceNotFoundException
|
||||||
from moto.eks.models import (
|
from moto.eks.models import (
|
||||||
@ -79,6 +80,8 @@ class TestNodegroup:
|
|||||||
|
|
||||||
@pytest.fixture(autouse=True, name="test_client")
|
@pytest.fixture(autouse=True, name="test_client")
|
||||||
def fixture_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)
|
backend = server.create_backend_app(service=SERVICE)
|
||||||
yield backend.test_client()
|
yield backend.test_client()
|
||||||
|
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
"""Test the different server responses."""
|
"""Test the different server responses."""
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import xmltodict
|
import xmltodict
|
||||||
|
import unittest
|
||||||
|
|
||||||
import moto.server as server
|
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
|
@mock_redshift
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
"""Test different server responses."""
|
"""Test different server responses."""
|
||||||
import json
|
import json
|
||||||
|
import pytest
|
||||||
|
import unittest
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
import pytest
|
from moto import settings
|
||||||
|
|
||||||
import moto.server as server
|
import moto.server as server
|
||||||
from tests.test_redshiftdata.test_redshiftdata_constants import (
|
from tests.test_redshiftdata.test_redshiftdata_constants import (
|
||||||
DEFAULT_ENCODING,
|
DEFAULT_ENCODING,
|
||||||
@ -13,6 +14,12 @@ from tests.test_redshiftdata.test_redshiftdata_constants import (
|
|||||||
CLIENT_ENDPOINT = "/"
|
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):
|
def headers(action):
|
||||||
return {
|
return {
|
||||||
"X-Amz-Target": f"RedshiftData.{action}",
|
"X-Amz-Target": f"RedshiftData.{action}",
|
||||||
|
@ -3,6 +3,7 @@ import json
|
|||||||
|
|
||||||
import boto3
|
import boto3
|
||||||
import pytest
|
import pytest
|
||||||
|
import unittest
|
||||||
|
|
||||||
import moto.server as server
|
import moto.server as server
|
||||||
from moto import mock_secretsmanager, mock_lambda, mock_iam, mock_logs, settings
|
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"
|
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
|
@mock_secretsmanager
|
||||||
def test_get_secret_value():
|
def test_get_secret_value():
|
||||||
|
|
||||||
@ -329,11 +336,7 @@ def test_rotate_secret_that_is_still_rotating():
|
|||||||
|
|
||||||
create_secret = test_client.post(
|
create_secret = test_client.post(
|
||||||
"/",
|
"/",
|
||||||
data={
|
data={"Name": DEFAULT_SECRET_NAME, "SecretString": "foosecret"},
|
||||||
"Name": DEFAULT_SECRET_NAME,
|
|
||||||
"SecretString": "foosecret",
|
|
||||||
# "VersionStages": ["AWSPENDING"],
|
|
||||||
},
|
|
||||||
headers={"X-Amz-Target": "secretsmanager.CreateSecret"},
|
headers={"X-Amz-Target": "secretsmanager.CreateSecret"},
|
||||||
)
|
)
|
||||||
create_secret = json.loads(create_secret.data.decode("utf-8"))
|
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"
|
assert json_data["__type"] == "InvalidParameterException"
|
||||||
|
|
||||||
|
|
||||||
if not settings.TEST_SERVER_MODE:
|
|
||||||
|
|
||||||
@mock_iam
|
@mock_iam
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
@mock_logs
|
@mock_logs
|
||||||
@ -499,6 +500,7 @@ if not settings.TEST_SERVER_MODE:
|
|||||||
logs = logs_conn.describe_log_streams(logGroupName="/aws/lambda/testFunction")
|
logs = logs_conn.describe_log_streams(logGroupName="/aws/lambda/testFunction")
|
||||||
assert len(logs["logStreams"]) == 4
|
assert len(logs["logStreams"]) == 4
|
||||||
|
|
||||||
|
|
||||||
@mock_iam
|
@mock_iam
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
@mock_logs
|
@mock_logs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user