# Path: cap_client/utils.py
# class ColoredGroup(HelpColorsGroup):
# class NotRequiredIf(click.Option):
# class MultipleMutuallyExclusiveOptions(click.Option):
#     def __init__(self, *args, **kwargs):
# def make_tarfile(output_filename, source_dir):
# def validate_version(ctx, param, version_value):
# def load_json_from_file(ctx, param, value):
# def load_json(ctx, param, value):
#     def __init__(self, *args, **kwargs):
#     def handle_parse_result(self, ctx, opts, args):
#     def __init__(self, *args, **kwargs):
#     def handle_parse_result(self, ctx, opts, args):
# def logger(fun):
#     def wrapper(*args, **kwargs):
# def pid_option(required):
#     def inner_pid_option(fun):
#         def wrapper(*args, **kwargs):


import json
import responses
from tempfile import NamedTemporaryFile
from cap_client.utils import json_dumps
                      },
                      'id': 'some-pid',
                      "metadata": {
                          "title": "my_analysis"
                      },
                  },
                  status=201)
    responses.add(
        responses.PUT,
        'https://analysispreservation-dev.cern.ch/api/deposits/some-pid',
        json={
            "created": "2020-03-25T09:25:19.578823+00:00",
            "metadata": {
                "title": "my_analysis"
            },
            "pid": "some-pid",
            "updated": "2020-03-25T09:25:19.904106+00:00"
        },
    )

    res = cli_run('analysis create --type lhcb --json {"title":"my_analysis"}')

    assert json.loads(responses.calls[0].request.body) == {
        "$ana_type": "lhcb",
        "title": "my_analysis"
    }

    assert responses.calls[0].request.headers[
        'Content-Type'] == 'application/json'
    assert responses.calls[1].request.headers[

# Path: cap_client/utils.py
# class ColoredGroup(HelpColorsGroup):
# class NotRequiredIf(click.Option):
# class MultipleMutuallyExclusiveOptions(click.Option):
#     def __init__(self, *args, **kwargs):
# def make_tarfile(output_filename, source_dir):
# def validate_version(ctx, param, version_value):
# def load_json_from_file(ctx, param, value):
# def load_json(ctx, param, value):
#     def __init__(self, *args, **kwargs):
#     def handle_parse_result(self, ctx, opts, args):
#     def __init__(self, *args, **kwargs):
#     def handle_parse_result(self, ctx, opts, args):
# def logger(fun):
#     def wrapper(*args, **kwargs):
# def pid_option(required):
#     def inner_pid_option(fun):
#         def wrapper(*args, **kwargs):


# Path: tests/unit/test_analysis_cli.py
import json
import responses
from tempfile import NamedTemporaryFile
from cap_client.utils import json_dumps

                      },
                      'id': 'some-pid',
                      "metadata": {
                          "title": "my_analysis"
                      },
                  },
                  status=201)
    responses.add(
        responses.PUT,
        'https://analysispreservation-dev.cern.ch/api/deposits/some-pid',
        json={
            "created": "2020-03-25T09:25:19.578823+00:00",
            "metadata": {
                "title": "my_analysis"
            },
            "pid": "some-pid",
            "updated": "2020-03-25T09:25:19.904106+00:00"
        },
    )

    res = cli_run('analysis create --type lhcb --json {"title":"my_analysis"}')

    assert json.loads(responses.calls[0].request.body) == {
        "$ana_type": "lhcb",
        "title": "my_analysis"
    }

    assert responses.calls[0].request.headers[
        'Content-Type'] == 'application/json'
    assert responses.calls[1].request.headers[

        'Accept'] == 'application/basic+json'