import pathlib


EXEC_UNIT_TEST = r'''
@pytest.mark.asyncio
async def test_\{\{function.name\}\}(hub, mock_hub, ctx):
    """
    Autogenerated function

    Test whether a call is successful and uses the expected parameters
    """
    mock_hub.exec.{{cookiecutter.service_name}}.R__SUBS__.R__FUNC_NAME = (
        hub.exec.{{cookiecutter.service_name}}.R__SUBS__.R__FUNC_NAME
    )

    await hub.exec.{{cookiecutter.service_name}}.\{\{plugin.subs\}\}.\{\{function.name\}\}(ctx, \{\{function.required_kwargs\}\})
    hub.tool.{{cookiecutter.service_name}}.session.request.assert_called_once_with(ctx)
'''

EXEC_INTEGRATION_TEST = r"""
@pytest.mark.asyncio
async def test_\{\{function.name\}\}(hub, ctx):
    ret = await hub.exec.{{cookiecutter.service_name}}.\{\{plugin.subs\}\}.\{\{plugin.name\}\}.\{\{function.name\}\}(
        ctx, \{\{function.required_kwargs\}\}
    )
    assert ret
"""


def run(hub, ctx, root_directory: pathlib.Path):
    # TODO
    ...
