def test_exec_in_container():
    """we test that we can manipulate a container via exec"""
    single = DockerCompose(context=FIXTURES / "port_single")
    with single:
        url = f"http://{single.get_service_host()}:{single.get_service_port()}"
        single.wait_for(url)

        # unchanged
        code, body = fetch(url)
        assert code == 200
        assert "test_exec_in_container" not in body

        # change it
        single.exec_in_container(
            command=["sh", "-c", 'echo "test_exec_in_container" > /usr/share/nginx/html/index.html']
        )

        # and it is changed
        code, body = fetch(url)
        assert code == 200
        assert "test_exec_in_container" in body
we test that we can manipulate a container via exec
core/tests/test_compose.py