예제 #1
0
def test_stop_task_timeout(mock_ecs_client, mock_ecs_cluster, mock_subnets):
    client = FakeECSClient(cluster=mock_ecs_cluster,
                           client=mock_ecs_client,
                           subnets=mock_subnets,
                           max_polls=1)
    with pytest.raises(ECSTimeout):
        client.stop_task("task arn", expected_statuses=["RUNNING", "RUNNING"])
예제 #2
0
def test_stop_task(mock_ecs_client, mock_ecs_cluster, mock_subnets):
    client = FakeECSClient(cluster=mock_ecs_cluster,
                           subnets=mock_subnets,
                           client=mock_ecs_client)

    assert client.stop_task("running task arn")
    assert not client.stop_task("already stopped task arn",
                                expected_statuses=["STOPPED"])