moto/tests/test_mediastore/test_mediastore.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

230 lines
8.6 KiB
Python
Raw Permalink Normal View History

Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
import boto3
import pytest
from botocore.exceptions import ClientError
2024-01-07 12:03:33 +00:00
from moto import mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
region = "eu-west-1"
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_create_container_succeeds():
client = boto3.client("mediastore", region_name=region)
response = client.create_container(
ContainerName="Awesome container!", Tags=[{"Key": "customer"}]
)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
container = response["Container"]
assert container["ARN"] == f"arn:aws:mediastore:container:{container['Name']}"
assert container["Name"] == "Awesome container!"
assert container["Status"] == "CREATING"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_describe_container_succeeds():
client = boto3.client("mediastore", region_name=region)
name = "Awesome container!"
client.create_container(ContainerName=name, Tags=[{"Key": "customer"}])
response = client.describe_container(ContainerName=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
container = response["Container"]
assert container["ARN"] == f"arn:aws:mediastore:container:{name}"
assert container["Name"] == name
assert container["Status"] == "ACTIVE"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_list_containers_succeeds():
client = boto3.client("mediastore", region_name=region)
name = "Awesome container!"
client.create_container(ContainerName=name, Tags=[{"Key": "customer"}])
containers = client.list_containers()["Containers"]
assert len(containers) == 1
client.create_container(ContainerName=f"{name}2", Tags=[{"Key": "customer"}])
containers = client.list_containers()["Containers"]
assert len(containers) == 2
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_describe_container_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.describe_container(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_lifecycle_policy_succeeds():
client = boto3.client("mediastore", region_name=region)
name = "container-name"
client.create_container(ContainerName=name, Tags=[{"Key": "customer"}])
client.put_lifecycle_policy(ContainerName=name, LifecyclePolicy="lifecycle-policy")
response = client.get_lifecycle_policy(ContainerName=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
assert response["LifecyclePolicy"] == "lifecycle-policy"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_lifecycle_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.put_lifecycle_policy(ContainerName="name", LifecyclePolicy="policy")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_lifecycle_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.get_lifecycle_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_lifecycle_policy_raises_error_if_container_does_not_have_lifecycle_policy():
client = boto3.client("mediastore", region_name=region)
client.create_container(ContainerName="container-name", Tags=[{"Key": "customer"}])
with pytest.raises(ClientError) as ex:
client.get_lifecycle_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "PolicyNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_container_policy_succeeds():
client = boto3.client("mediastore", region_name=region)
name = "container-name"
client.create_container(ContainerName=name)
client.put_container_policy(ContainerName=name, Policy="container-policy")
response = client.get_container_policy(ContainerName=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
assert response["Policy"] == "container-policy"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_container_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.put_container_policy(ContainerName="name", Policy="policy")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_container_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.get_container_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_container_policy_raises_error_if_container_does_not_have_container_policy():
client = boto3.client("mediastore", region_name=region)
client.create_container(ContainerName="container-name", Tags=[{"Key": "customer"}])
with pytest.raises(ClientError) as ex:
client.get_container_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "PolicyNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_metric_policy_succeeds():
client = boto3.client("mediastore", region_name=region)
name = "container-name"
client.create_container(ContainerName=name)
client.put_metric_policy(
ContainerName=name,
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
MetricPolicy={"ContainerLevelMetrics": "ENABLED"},
)
response = client.get_metric_policy(ContainerName=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
assert response["MetricPolicy"] == {"ContainerLevelMetrics": "ENABLED"}
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_put_metric_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.put_metric_policy(
ContainerName="container-name",
MetricPolicy={"ContainerLevelMetrics": "ENABLED"},
)
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_metric_policy_raises_error_if_container_does_not_exist():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.get_metric_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "ResourceNotFoundException"
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
Implementation of core AWS Mediastore endpoints (#3825) * write boilerplate code * generate boilerplate code with scaffold script * create mediapackage channel * remove duplicate mediapackage reference * remove Channel key from mediapackage response * describe_channel endpoint added * create_origin_endpoint-added * keys changed to camel case to fix issue * minor changes to clean up * minor clean up again * implement & test delete_channel * delete origin endpoint created; WIP-tests failing * fix delete_origin_endpoint issue * refactor function call * delete origin endpoint completed; test_server tests added * implement and test describe_origin_endpoint * update origin endpoint added * remove print statements * implement test_list_origin_endpoint_succeeds * create test name changed * create test name changed * changes after flake8 and black run * url assertion added to decribe origin endpoint test * region dependent url enabled * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well * Mediastore (#20) * initial commit; WIP * create container added, still WIP * create_container working * test_create_channel_succeeds * test_describe_container_succeeds * get_lifecycle_policy added; error tests added * changes to pass linting * added exception for container but no policy * linting * put_container_policy added * put_metric_policy added * list_containers added * resolved linting * test_describe_container_raises_error_if_container_does_not_exist * added __init__ file * __init__ added to mediapackage as well Co-authored-by: FranckNdame <franck.mpouli@yahoo.com> * test_server fixed; resolved rebasing mix ups on tests * [FIX] Ensures MediaConnect create_flow sets a valid sourceArn * code clean up Co-authored-by: Anya <anya.champaneria@capablue.com> Co-authored-by: AnyaChamp <71766808+AnyaChamp@users.noreply.github.com>
2021-04-08 15:51:50 +00:00
def test_get_metric_policy_raises_error_if_container_does_not_have_metric_policy():
client = boto3.client("mediastore", region_name=region)
client.create_container(ContainerName="container-name", Tags=[{"Key": "customer"}])
with pytest.raises(ClientError) as ex:
client.get_metric_policy(ContainerName="container-name")
assert ex.value.response["Error"]["Code"] == "PolicyNotFoundException"
2024-01-07 12:03:33 +00:00
@mock_aws
def test_list_tags_for_resource():
client = boto3.client("mediastore", region_name=region)
tags = [{"Key": "customer"}]
name = "Awesome container!"
client.create_container(ContainerName=name, Tags=tags)
response = client.list_tags_for_resource(Resource=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
assert response["Tags"] == tags
2024-01-07 12:03:33 +00:00
@mock_aws
def test_list_tags_for_resource_return_none_if_no_tags():
client = boto3.client("mediastore", region_name=region)
name = "Awesome container!"
client.create_container(ContainerName=name)
response = client.list_tags_for_resource(Resource=name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
assert response.get("Tags") is None
2024-01-07 12:03:33 +00:00
@mock_aws
def test_list_tags_for_resource_return_error_for_unknown_resource():
client = boto3.client("mediastore", region_name=region)
with pytest.raises(ClientError) as ex:
client.list_tags_for_resource(Resource="not_existing")
assert ex.value.response["Error"]["Code"] == "ContainerNotFoundException"
2024-01-07 12:03:33 +00:00
@mock_aws
def test_delete_container():
client = boto3.client("mediastore", region_name=region)
container_name = "Awesome container!"
client.create_container(ContainerName=container_name)
response = client.delete_container(ContainerName=container_name)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200
containers = client.list_containers()["Containers"]
assert not any(d["Name"] == container_name for d in containers)
2024-01-07 12:03:33 +00:00
@mock_aws
def test_delete_container_raise_error_if_container_not_found():
client = boto3.client("mediastore", region_name=region)
client.create_container(ContainerName="Awesome container!")
with pytest.raises(ClientError) as ex:
client.delete_container(ContainerName="notAvailable")
assert ex.value.response["Error"]["Code"] == "ContainerNotFoundException"