def test_not_changed_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "script": {
            "commands": [{
                "name": "test",
                "arguments": [{
                    "name": "test"
                }]
            }]
        }
    }
    validator.current_integration = {
        "script": {
            "commands": [{
                "name": "test",
                "arguments": [{
                    "name": "test"
                }]
            }]
        }
    }

    assert validator.is_changed_command_name_or_arg() is False, "The script validator found a backward compatibility " \
        "issue although the commands haven't changed"
def test_added_required_arg_for_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "script": {
            "commands": [{
                "name": "test",
                "arguments": [{
                    "name": "test"
                }]
            }]
        }
    }
    validator.current_integration = {
        "script": {
            "commands": [{
                "name":
                "test",
                "arguments": [{
                    "name": "test",
                }, {
                    "name": "test1",
                    "required": True
                }]
            }]
        }
    }

    assert validator.is_changed_command_name_or_arg(), "The script validator did not found a backward compatibility " \
        "issue although the command was added with required arg"
Beispiel #3
0
def test_not_requires_arg_in_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "commands": [
            {
                "name": "test",
                "arguments": [
                    {
                        "name": "test"
                    }
                ]
            }
        ]
    }
    validator.current_integration = {
        "commands": [
            {
                "name": "test",
                "arguments": [
                    {
                        "name": "test"
                    },
                    {
                        "name": "test1",
                    }
                ]
            }
        ]
    }

    assert validator.is_changed_command_name_or_arg() is False, "The script validator found a backward compatibility " \
        "issue although a new not required command was added"
Beispiel #4
0
def test_not_changed_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "script": {
            "commands": [
                {
                    "name": "test",
                    "arguments": [
                        {
                            "name": "test"
                        }
                    ]
                }
            ]
        }
    }
    validator.current_integration = {
        "script": {
            "commands": [
                {
                    "name": "test",
                    "arguments": [
                        {
                            "name": "test"
                        }
                    ]
                }
            ]
        }
    }

    assert validator.is_changed_command_name_or_arg() is False, "The script validator found a backward compatibility " \
        "issue although the commands haven't changed"
Beispiel #5
0
def test_not_requires_arg_in_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "commands": [
            {
                "name": "test",
                "arguments": [
                    {
                        "name": "test"
                    }
                ]
            }
        ]
    }
    validator.current_integration = {
        "commands": [
            {
                "name": "test",
                "arguments": [
                    {
                        "name": "test"
                    },
                    {
                        "name": "test1",
                    }
                ]
            }
        ]
    }

    assert validator.is_changed_command_name_or_arg() is False, "The script validator found a backward compatibility " \
        "issue although a new not required command was added"
Beispiel #6
0
def test_changed_required_arg_for_command_in_integration():
    validator = IntegrationValidator("temp_file", check_git=False)
    validator.old_integration = {
        "script": {
            "commands": [
                {
                    "name": "test",
                    "arguments": [
                        {
                            "name": "test"
                        }
                    ]
                }
            ]
        }
    }
    validator.current_integration = {
        "script": {
            "commands": [
                {
                    "name": "test",
                    "arguments": [
                        {
                            "name": "test",
                            "required": True
                        }
                    ]
                }
            ]
        }
    }

    assert validator.is_changed_command_name_or_arg(), "The script validator did not found a backward compatibility " \
        "issue although the command was added with required arg"