moto/tests/test_ecs/test_ecs_efs.py
2023-11-30 14:55:51 -01:00

43 lines
1.1 KiB
Python

import boto3
from moto import mock_ecs, mock_efs
@mock_ecs
@mock_efs
def test_register_task_definition__use_efs_root():
client = boto3.client("ecs", region_name="us-east-1")
container_definition = {
"name": "hello_world",
"image": "docker/hello-world:latest",
"cpu": 1024,
"memory": 400,
}
task_definition = client.register_task_definition(
family="test_ecs_task",
containerDefinitions=[container_definition],
volumes=[
{
"name": "vol1",
"efsVolumeConfiguration": {
"fileSystemId": "sth",
"transitEncryption": "ENABLED",
},
}
],
)
family = task_definition["taskDefinition"]["family"]
task = client.describe_task_definition(taskDefinition=family)["taskDefinition"]
assert task["volumes"] == [
{
"name": "vol1",
"efsVolumeConfiguration": {
"fileSystemId": "sth",
"rootDirectory": "/",
"transitEncryption": "ENABLED",
},
}
]