# Path: tests/functional/ucare_cli/helpers.py
# def arg_namespace(arguments_str):
#     return ucare_argparser().parse_args(arguments_str.split())
# 
# Path: pyuploadcare/ucare_cli/commands/create_group.py
# def create_group(arg_namespace, client: Uploadcare):
#     files = [client.file(uuid) for uuid in arg_namespace.paths]
#     group = client.create_file_group(files)
#     pprint(group.info)
# 
# Path: pyuploadcare/ucare_cli/commands/list_groups.py
# def list_groups(arg_namespace, client: Uploadcare):
#     return _list(client.list_file_groups, arg_namespace)


import pytest
from tests.functional.ucare_cli.helpers import arg_namespace
from pyuploadcare.ucare_cli.commands.create_group import create_group
from pyuploadcare.ucare_cli.commands.list_groups import list_groups



@pytest.mark.vcr
def test_group_create_by_uuid_and_cdn_url(capsys, uploadcare):
    create_group(
        arg_namespace(
            "create_group a42464a4-b57a-458e-8b9d-3e6d72db9d60"
            " https://api.uploadcare.com/files/7ac0a1c3-5476-4d6a-b03d-0acf7ae6d4ae/"
        ),
        uploadcare,
    )
    captured = capsys.readouterr()
    assert '"files_count": 2' in captured.out
    assert "a42464a4-b57a-458e-8b9d-3e6d72db9d60" in captured.out
    assert "7ac0a1c3-5476-4d6a-b03d-0acf7ae6d4ae" in captured.out


@pytest.mark.vcr
def test_groups_list_without_params(capsys, uploadcare):
    list_groups(arg_namespace("list_groups"), uploadcare)
    captured = capsys.readouterr()
    assert '"files_count": 3' in captured.out


@pytest.mark.vcr
def test_groups_list_with_params(capsys, uploadcare):
    list_groups(

# Path: tests/functional/ucare_cli/helpers.py
# def arg_namespace(arguments_str):
#     return ucare_argparser().parse_args(arguments_str.split())
# 
# Path: pyuploadcare/ucare_cli/commands/create_group.py
# def create_group(arg_namespace, client: Uploadcare):
#     files = [client.file(uuid) for uuid in arg_namespace.paths]
#     group = client.create_file_group(files)
#     pprint(group.info)
# 
# Path: pyuploadcare/ucare_cli/commands/list_groups.py
# def list_groups(arg_namespace, client: Uploadcare):
#     return _list(client.list_file_groups, arg_namespace)


# Path: tests/functional/ucare_cli/test_file_group.py
import pytest
from tests.functional.ucare_cli.helpers import arg_namespace
from pyuploadcare.ucare_cli.commands.create_group import create_group
from pyuploadcare.ucare_cli.commands.list_groups import list_groups




@pytest.mark.vcr
def test_group_create_by_uuid_and_cdn_url(capsys, uploadcare):
    create_group(
        arg_namespace(
            "create_group a42464a4-b57a-458e-8b9d-3e6d72db9d60"
            " https://api.uploadcare.com/files/7ac0a1c3-5476-4d6a-b03d-0acf7ae6d4ae/"
        ),
        uploadcare,
    )
    captured = capsys.readouterr()
    assert '"files_count": 2' in captured.out
    assert "a42464a4-b57a-458e-8b9d-3e6d72db9d60" in captured.out
    assert "7ac0a1c3-5476-4d6a-b03d-0acf7ae6d4ae" in captured.out


@pytest.mark.vcr
def test_groups_list_without_params(capsys, uploadcare):
    list_groups(arg_namespace("list_groups"), uploadcare)
    captured = capsys.readouterr()
    assert '"files_count": 3' in captured.out


@pytest.mark.vcr
def test_groups_list_with_params(capsys, uploadcare):
    list_groups(

        arg_namespace(