示例#1
0
def test_is_default_arguments_ok():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.current_integration = {
        "script": {
            "commands": [
                {
                    "name": "email",
                    "arguments": [
                        {
                            "name": "email",
                            "required": False,
                            "default": True
                        },
                        {
                            "name": "verbose"
                        }
                    ]
                }
            ]
        }
    }
    validator.old_integration = None

    assert validator.is_default_arguments() is True, \
        "The integration validator found an invalid command arg while it is valid"
示例#2
0
def test_is_default_arguments_non_default():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.current_integration = {
        "script": {
            "commands": [
                {
                    "name": "file",
                    "arguments": [
                        {
                            "name": "file",
                            "required": True,
                            "default": False
                        },
                        {
                            "name": "verbose"
                        }
                    ]
                }
            ]
        }
    }
    validator.old_integration = None

    assert validator.is_default_arguments() is False, \
        "The integration validator did not find invalid arg (needed to be default and not required)"