コード例 #1
0
ファイル: conf_test.py プロジェクト: luongthomas/demisto-sdk
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"
コード例 #2
0
ファイル: conf_test.py プロジェクト: luongthomas/demisto-sdk
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"
コード例 #3
0
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"
コード例 #4
0
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"