moto
moto copied to clipboard
FEATURE REQUEST: Amazon Managed Prometheus (AMP) Coverage
Currently, AMP is not covered by Moto. For mock unit testing of boto-managed units/specs, as an automation engineer, I want to be able to unit test Amazon Managed Prometheus (AMP) services, specifically the following, to ensure independent unit test coverage of scripts / automation that use AMP:
- create_workspace()
- create_rule_groups_namespace()
- list_workspaces()
- describe_workspace()
- list_rule_groups_namespaces()
- describe_rule_groups_namespace()
- ... and the related paginators
Expected behavior (in PyTest):
conftest.py
from moto import mock_amp
@pytest.fixture
def aws_credentials():
"""Mocked AWS Credentials for moto."""
os.environ["AWS_ACCESS_KEY_ID"] = "testing"
os.environ["AWS_SECRET_ACCESS_KEY"] = "testing"
os.environ["AWS_SECURITY_TOKEN"] = "testing"
os.environ["AWS_SESSION_TOKEN"] = "testing"
@pytest.fixture
def amp_client(aws_credentials):
with mock_amp():
conn = boto3.client("amp")
yield conn
... and in test file:
import pytest
import boto3.amp
@pytest.fixture()
def mock_amp_workspace(amp_client):
workspace = amp_client.create_workspace(
alias='fake_amp_workspace'
)
yield workspace