def test_is_changed_subtype_python3(): validator = ScriptValidator("temp_file", check_git=False) validator.current_script = {"type": "python", "subtype": "python3"} validator.old_script = {"type": "python", "subtype": "python3"} assert validator.is_changed_subtype() is False, \ "found changed subtype while it was not changed"
def test_is_changed_subtype_python2_to_3(): validator = ScriptValidator("temp_file", check_git=False) validator.current_script = {"type": "python", "subtype": "python3"} validator.old_script = {"type": "python", "subtype": "python2"} assert validator.is_changed_subtype() is True, \ "Did not find changed subtype while it was changed"
def test_updated_docker_image_on_sane_doc_reports_fail_subtype(): validator = ScriptValidator('Scripts/SaneDocReport/SaneDocReport.yml', check_git=False) validator.current_script = {"type": "python", "subtype": "python3"} validator.old_script = {"type": "python", "subtype": "python2"} assert validator.is_changed_subtype() is True, \ "Did not find changed subtype while it was changed" assert validator.is_backward_compatible( ) is False, "The script validator passed sane-doc-reports"