Example #1
0
def test_moved_arg_in_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "+   - name: sadf\n-   - name: sadf"

    assert validator.is_arg_changed() is False, "The script validator found the arg list has breaking backward " \
        "compatability although just reordered the existing arg list"
Example #2
0
def test_untouched_arg_list_in_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "not changed arg list"

    assert validator.is_arg_changed() is False, "The script validator found the arg list has breaking backward " \
        "compatability although it was not touched"
Example #3
0
def test_deleted_arg_from_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "- - name: sadf"

    assert validator.is_arg_changed(), "The script validator couldn't find deleted arg name"
Example #4
0
def test_added_arg_to_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "+   - name: sadf"

    assert validator.is_arg_changed() is False, "The script validator found the arg list has breaking backward " \
        "compatability although just new option was added"
Example #5
0
def test_not_changed_context_path():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "not changed context path"

    assert validator.is_context_path_changed() is False, "The script validator couldn't find the context " \
        "path as not touched"
Example #6
0
def test_added_new_context_path():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "+   - contextPath: sadf"

    assert validator.is_context_path_changed() is False, "The script validator found an existing context path as " \
        "changed although it is not, but new context path added to a command"
Example #7
0
def test_moved_context_path():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "-   - contextPath: sadf\n+   - contextPath: sadf"

    assert validator.is_context_path_changed() is False, "The script validator couldn't find the context " \
        "path as the same"
Example #8
0
def test_changed_context_path():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "-   - contextPath: sadf\n+   - contextPath: abc"

    assert validator.is_context_path_changed(), "The script validator couldn't find the context path as updated"
Example #9
0
def test_removed_docker_image_on_existing_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "-   dockerimage: sadf"

    assert validator.is_docker_image_changed(), "The script validator couldn't find the docker image as changed"
Example #10
0
def test_not_changed_docker_image_on_existing_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "some text"

    assert validator.is_docker_image_changed() is False, "The script validator couldn't find the docker "\
        "image as changed"
Example #11
0
def test_changed_arg_in_script():
    validator = ScriptValidator("temp_file", check_git=False)
    validator.change_string = "+   - name: old_name\n-   - name: new_name\n+   - name: new_name"

    assert validator.is_arg_changed() is False, "The script validator didn't found the arg list has breaking " \
        "backward compatability although an arg was renamed"