示例#1
0
    def test_get_error_ignore_list(self, mocker):
        files_path = os.path.normpath(
            os.path.join(__file__, f'{git_path()}/demisto_sdk/tests', 'test_files'))
        test_file = os.path.join(files_path, 'fake_pack/.pack-ignore')

        mocker.patch.object(FilesValidator, 'get_pack_ignore_file_path', return_value=test_file)

        file_validator = FilesValidator()
        ignore_errors_list = file_validator.get_error_ignore_list("fake")
        assert ignore_errors_list['file_name'] == ['BA101', 'IF107']
        assert 'SC100' not in ignore_errors_list['file_name']
示例#2
0
    def test_get_error_ignore_list__file_validator(self, mocker):
        """
            Given:
                - A file path to pack ignore
            When:
                - running get_error_ignore_list from file validator
            Then:
                - verify that the created ignored_errors list is correct
        """
        files_path = os.path.normpath(
            os.path.join(__file__, f'{git_path()}/demisto_sdk/tests', 'test_files'))
        test_file = os.path.join(files_path, 'fake_pack/.pack-ignore')

        mocker.patch.object(FilesValidator, 'get_pack_ignore_file_path', return_value=test_file)

        file_validator = FilesValidator()
        ignore_errors_list = file_validator.get_error_ignore_list("fake")
        assert ignore_errors_list['file_name'] == ['BA101', 'IF107']
        assert 'SC100' not in ignore_errors_list['file_name']