def test_the_existence_of_added_test_in_conf_json(): validator = ConfJsonValidator() validator.conf_data = {"tests": TESTS_SECTION} assert validator.is_test_in_conf_json(file_id="alexa"), \ "The conf validator didn't catch the test although it exists in the test list"
def test_the_missing_existence_of_added_test_in_conf_json(): validator = ConfJsonValidator() validator.conf_data = {"tests": TESTS_SECTION} assert validator.is_test_in_conf_json(file_id="cortana") is False, \ "The conf validator didn't catch that the test is missing"
def test_the_existence_of_added_test_in_conf_json(mocker): mocker.patch( 'demisto_sdk.commands.common.hook_validations.conf_json.ConfJsonValidator.load_conf_file', return_value={"tests": TESTS_SECTION}) validator = ConfJsonValidator() assert validator.is_test_in_conf_json(file_id="alexa"), \ "The conf validator didn't catch the test although it exists in the test list"
def test_the_missing_existence_of_added_test_in_conf_json(mocker): mocker.patch( 'demisto_sdk.commands.common.hook_validations.conf_json.ConfJsonValidator.load_conf_file', return_value={"tests": TESTS_SECTION}) validator = ConfJsonValidator() assert validator.is_test_in_conf_json(file_id="cortana") is False, \ "The conf validator didn't catch that the test is missing"