def test_check_support_status_community_file(repo, mocker): """ Given - An community supported integration yml. When - Running check_support_status method. Then - Ensure the resulting ignored errors list does not include the integration file name. """ pack = repo.create_pack('pack') integration = pack.create_integration('integration') meta_json = { PACK_METADATA_SUPPORT: "community", PACK_METADATA_CERTIFICATION: "not certified" } mocker.patch.object(BaseValidator, 'get_metadata_file_content', return_value=meta_json) pack.pack_metadata.write_json(meta_json) with ChangeCWD(repo.path): base_validator = BaseValidator(ignored_errors={}) base_validator.update_checked_flags_by_support_level( integration.yml_path) assert base_validator.ignored_errors[ 'integration.yml'] == PRESET_ERROR_TO_IGNORE['community']
def test_check_support_status_certified_partner_file(repo, mocker): """ Given - An certified partner supported integration yml. When - Running check_support_status method. Then - Ensure the resulting ignored errors list includes the community ignore-list. """ pack = repo.create_pack('pack') integration = pack.create_integration('integration') meta_json = { PACK_METADATA_SUPPORT: "partner", PACK_METADATA_CERTIFICATION: "certified" } mocker.patch.object(BaseValidator, 'get_metadata_file_content', return_value=meta_json) pack.pack_metadata.write_json(meta_json) with ChangeCWD(repo.path): base_validator = BaseValidator(ignored_errors={}) base_validator.update_checked_flags_by_support_level( integration.yml_path) assert 'integration.yml' not in base_validator.ignored_errors
def test_check_support_status_partner_file(repo, mocker): """ Given - An partner supported integration yml. When - Running check_support_status method. Then - Ensure the resulting ignored errors list includes the partner ignore-list. """ pack = repo.create_pack('pack') integration = pack.create_integration('integration') meta_json = {PACK_METADATA_SUPPORT: "partner"} mocker.patch.object(BaseValidator, 'get_metadata_file_content', return_value=meta_json) pack.pack_metadata.write_json(meta_json) with ChangeCWD(repo.path): base_validator = BaseValidator(ignored_errors={}) base_validator.update_checked_flags_by_support_level( integration.yml.rel_path) assert base_validator.ignored_errors[ 'integration.yml'] == PRESET_ERROR_TO_IGNORE['partner']
def test_check_support_status_community_file(repo, mocker): """ Given - An community supported integration yml. When - Running check_support_status method. Then - Ensure the 'predefined by support ignored errors' list includes the community ignore-list. """ pack = repo.create_pack('pack') integration = pack.create_integration('integration') meta_json = {PACK_METADATA_SUPPORT: "community"} mocker.patch.object(BaseValidator, 'get_metadata_file_content', return_value=meta_json) pack.pack_metadata.write_json(meta_json) with ChangeCWD(repo.path): base_validator = BaseValidator(ignored_errors={}) base_validator.update_checked_flags_by_support_level( integration.yml.rel_path) assert base_validator.predefined_by_support_ignored_errors[ integration.yml.rel_path] == PRESET_ERROR_TO_IGNORE[ 'community'] # noqa: E501
def test_check_support_status_xsoar_file(repo, mocker): """ Given - An xsoar supported integration yml. When - Running check_support_status method. Then - Ensure the resulting ignored errors list does not include the integration file name. """ pack = repo.create_pack('pack') integration = pack.create_integration('integration') meta_json = {PACK_METADATA_SUPPORT: "xsoar"} mocker.patch.object(BaseValidator, 'get_metadata_file_content', return_value=meta_json) pack.pack_metadata.write_json(meta_json) with ChangeCWD(repo.path): base_validator = BaseValidator(ignored_errors={}) base_validator.update_checked_flags_by_support_level( integration.yml.rel_path) assert 'integration.yml' not in base_validator.ignored_errors