summaryrefslogblamecommitdiffstats
path: root/tests/test_core.py
blob: cc4755f48e619dbaff7bb0c3f83b03805cf17a97 (plain) (tree)
1
2
3
4
5
6
7
8
9

             

             
 


                                                                 
 




























                                                                      
import click
import pickle
import pytest


def test_get_option_arguments_ok(valid_arguments):
    # core.get_option_arguments(schema, parameter, "mega-option")
    pass


def test_generate_cli_options_start(valid_command_entrypoint):

    with pytest.raises(SystemExit):
        valid_command_entrypoint()


@pytest.mark.parametrize(
    "argument_info",
    [
        ["name", ["--name"], click.STRING],
        ["version", ["--version"], click.IntRange(min=0)],
        ["force", ["--force"], click.BOOL],
        ["fruit", ["--fruit"], click.STRING],
    ]
)
def test_generate_cli_options_arguments(
    valid_command_entrypoint,
    argument_info,
):
    option = next(
        filter(
            lambda el: el.name == argument_info[0],
            valid_command_entrypoint.params
        )
    )

    assert option.opts == argument_info[1]
    assert pickle.dumps(option.type) == pickle.dumps(argument_info[2])
remember that computers suck.