From 3b1526fe0539977c942b6e1227cc8ff90d8a47ce Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Wed, 14 Aug 2024 13:01:12 +0800 Subject: [PATCH] #63 - Update link references of ownership from nexB to aboutcode-org Signed-off-by: Chin Yeung Li --- NOTICE | 2 +- README.rst | 18 +- configure | 2 +- configure.bat | 2 +- extractcode | 2 +- extractcode.ABOUT | 4 +- extractcode.bat | 2 +- setup.cfg | 2 +- src/extractcode/NOTICE | 2 +- src/extractcode/__init__.py | 5 +- src/extractcode/api.py | 2 +- src/extractcode/archive.py | 62 +- src/extractcode/cli.py | 32 +- src/extractcode/extract.py | 17 +- src/extractcode/libarchive2.py | 10 +- src/extractcode/patch.py | 5 +- src/extractcode/sevenzip.py | 19 +- src/extractcode/uncompress.py | 5 +- src/extractcode/vmimage.py | 10 +- tests/extractcode_assert_utils.py | 7 +- tests/test_archive.py | 289 ++++--- tests/test_extract.py | 77 +- tests/test_extractcode.py | 2 +- tests/test_extractcode_api.py | 8 +- tests/test_extractcode_cli.py | 57 +- tests/test_libarchive2.py | 2 +- tests/test_patch.py | 1166 +++++++++++++++++++---------- tests/test_sevenzip.py | 117 ++- tests/test_vmimage.py | 11 +- 29 files changed, 1253 insertions(+), 686 deletions(-) diff --git a/NOTICE b/NOTICE index ad3576b..0a82990 100644 --- a/NOTICE +++ b/NOTICE @@ -3,6 +3,6 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/README.rst b/README.rst index e72417d..ac262e4 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ ExtractCode - license: Apache-2.0 - copyright: copyright (c) nexB. Inc. and others -- homepage_url: https://github.com/nexB/extractcode +- homepage_url: https://github.com/aboutcode-org/extractcode - keywords: archive, extraction, libarchive, 7zip, scancode-toolkit, extractcode Supports Windows, Linux and macOS on 64 bits processors and Python 3.6 to 3.9. @@ -83,7 +83,7 @@ libmagic) to select the most appropriate extractor or decompressor function. It can handle multi-level archives such as tar.gz and can extract recursively any nested archives. -Visit https://aboutcode.org and https://github.com/nexB/ for support and download. +Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download. We run CI tests on: @@ -109,7 +109,7 @@ In this case, you will need to provide a working and compatible libarchive and find them: - **a typecode-libarchive and typecode-7z plugin**: See the standard ones at - https://github.com/nexB/scancode-plugins/tree/main/builtins + https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins These can either bundle a libarchive library, a 7z executable or expose a system-installed libraries. It does so by providing plugin entry points as ``scancode_location_provider`` @@ -121,8 +121,8 @@ find them: See for example: - - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/setup.py#L40 - - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/src/extractcode_libarchive/__init__.py#L17 + - https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/setup.py#L40 + - https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_libarchive-linux/src/extractcode_libarchive/__init__.py#L17 And in the same way, the ``scancode_location_provider`` for ``extractcode_7zip`` should point to a ``LocationProviderPlugin`` subclass with a ``get_locations()`` @@ -132,8 +132,8 @@ find them: See for example: - - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/setup.py#L40 - - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/src/extractcode_7z/__init__.py#L18 + - https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/setup.py#L40 + - https://github.com/aboutcode-org/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/extractcode_7z-linux/src/extractcode_7z/__init__.py#L18 - use **environment variables** to point to installed binaries: @@ -181,14 +181,14 @@ ExtractCode will use these environment variables if set: - EXTRACTCODE_LIBARCHIVE_PATH : the path to the ``libarchive.so`` libarchive shared library used to support some of the archive formats. If not provided, ExtractCode will look for a plugin-provided libarchive library path. See - https://github.com/nexB/scancode-plugins/tree/main/builtins for such plugins. + https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins for such plugins. If no plugin contributes libarchive, then a final attempt is made to look for it in the PATH using standard DLL loading techniques. - EXTRACTCODE_7Z_PATH : the path to the ``7z`` 7zip executable used to support some of the archive formats. If not provided, ExtractCode will look for a plugin-provided 7z executable path. See - https://github.com/nexB/scancode-plugins/tree/main/builtins for such plugins. + https://github.com/aboutcode-org/scancode-plugins/tree/main/builtins for such plugins. If no plugin contributes 7z, then a final attempt is made to look for it in the PATH. diff --git a/configure b/configure index eff6d02..472c330 100755 --- a/configure +++ b/configure @@ -3,7 +3,7 @@ # Copyright (c) nexB Inc. and others. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/ for support or download. +# See https://github.com/aboutcode-org/ for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/configure.bat b/configure.bat index 233528f..db593ac 100644 --- a/configure.bat +++ b/configure.bat @@ -4,7 +4,7 @@ @rem Copyright (c) nexB Inc. and others. All rights reserved. @rem SPDX-License-Identifier: Apache-2.0 @rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -@rem See https://github.com/nexB/ for support or download. +@rem See https://github.com/aboutcode-org/ for support or download. @rem See https://aboutcode.org for more information about nexB OSS projects. diff --git a/extractcode b/extractcode index bb91c2a..c011502 100755 --- a/extractcode +++ b/extractcode @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # ScanCode is a trademark of nexB Inc. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # # A minimal shell wrapper to the CLI entry point fo ExtractCode diff --git a/extractcode.ABOUT b/extractcode.ABOUT index 75e231d..b4b2597 100644 --- a/extractcode.ABOUT +++ b/extractcode.ABOUT @@ -2,9 +2,9 @@ about_resource: . copyright: copyright (c) nexB. Inc. and others description: A mostly universal archive extractor using 7zip, libarchive and the Python standard library for reliable archive extraction on Linux, Windows and - macOS. It is used by ScanCode toolkit and related projects. + macOS. It is used by ScanCode toolkit and related projects. keywords: archive, extraction, libarchive, 7zip, gzip, xz, lzma, bzip2, tar, ar, cpio, scancode-toolkit -homepage_url: https://github.com/nexB/extractcode +homepage_url: https://github.com/aboutcode-org/extractcode holder: nexB. Inc. and others holder_contact: info@aboutcode.org license_expression: apache-2.0 diff --git a/extractcode.bat b/extractcode.bat index d9d081f..6f38fc1 100644 --- a/extractcode.bat +++ b/extractcode.bat @@ -4,7 +4,7 @@ @rem SPDX-License-Identifier: Apache-2.0 @rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text. @rem ScanCode is a trademark of nexB Inc. -@rem See https://github.com/nexB/extractcode for support or download. +@rem See https://github.com/aboutcode-org/extractcode for support or download. @rem See https://aboutcode.org for more information about nexB OSS projects. @rem A wrapper to ExtractCode command line entry point diff --git a/setup.cfg b/setup.cfg index cae2e90..a352f1f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ license = Apache-2.0 description = A mostly universal archive extractor using 7zip, libarchive and the Python standard library for reliable archive extraction. long_description = file:README.rst long_description_content_type = text/x-rst -url = https://github.com/nexB/extractcode +url = https://github.com/aboutcode-org/extractcode author = nexB. Inc. and others author_email = info@aboutcode.org diff --git a/src/extractcode/NOTICE b/src/extractcode/NOTICE index ad3576b..0a82990 100644 --- a/src/extractcode/NOTICE +++ b/src/extractcode/NOTICE @@ -3,6 +3,6 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/src/extractcode/__init__.py b/src/extractcode/__init__.py index fb6095d..a069ca1 100644 --- a/src/extractcode/__init__.py +++ b/src/extractcode/__init__.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -123,7 +123,8 @@ def remove_backslashes_and_dotdots(directory): continue try: new_path = as_posixpath(filename).strip('/') - new_path = posixpath.normpath(new_path).replace('..', '/').strip('/') + new_path = posixpath.normpath( + new_path).replace('..', '/').strip('/') new_path = posixpath.normpath(new_path) segments = new_path.split('/') directory = join(top, *segments[:-1]) diff --git a/src/extractcode/api.py b/src/extractcode/api.py index 38d83b2..4042d57 100644 --- a/src/extractcode/api.py +++ b/src/extractcode/api.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/src/extractcode/archive.py b/src/extractcode/archive.py index d52399e..6327fb6 100644 --- a/src/extractcode/archive.py +++ b/src/extractcode/archive.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -102,7 +102,7 @@ def should_extract(location, kinds, ignore_pattern=()): """ location = os.path.abspath(os.path.expanduser(location)) ignore_pattern = { - extension : 'User ignore: Supplied by --ignore' + extension: 'User ignore: Supplied by --ignore' for extension in ignore_pattern } should_ignore = is_ignored(location, ignore_pattern) @@ -218,10 +218,13 @@ def get_handlers(location): raise Exception('Maximum level of archive nesting is two.') # default to False - type_matched = handler.filetypes and any(t in ftype for t in handler.filetypes) + type_matched = handler.filetypes and any( + t in ftype for t in handler.filetypes) if TRACE_DEEP: - logger.debug(f' get_handlers: handler.filetypes={handler.filetypes}') - mime_matched = handler.mimetypes and any(m in mtype for m in handler.mimetypes) + logger.debug( + f' get_handlers: handler.filetypes={handler.filetypes}') + mime_matched = handler.mimetypes and any( + m in mtype for m in handler.mimetypes) exts = handler.extensions if exts: extension_matched = exts and location.lower().endswith(exts) @@ -230,7 +233,7 @@ def get_handlers(location): print( f' get_handlers: matched type: {type_matched}, ' f'mime: {mime_matched}, ext: {extension_matched}' % locals() - ) + ) if ( handler.strict @@ -247,7 +250,8 @@ def get_handlers(location): if type_matched or mime_matched or extension_matched: if TRACE_DEEP: handler_name = handler.name - logger.debug(' get_handlers: yielding handler: %(handler_name)r' % locals()) + logger.debug( + ' get_handlers: yielding handler: %(handler_name)r' % locals()) yield handler, type_matched, mime_matched, extension_matched @@ -267,7 +271,8 @@ def score_handlers(handlers): # increment kind value: higher kinds numerical values are more # specific by design score += handler.kind - if TRACE_DEEP: logger.debug(f' score_handlers: score += handler.kind {score}') + if TRACE_DEEP: + logger.debug(f' score_handlers: score += handler.kind {score}') # increment score based on matched criteria if type_matched and mime_matched and extension_matched: @@ -384,13 +389,15 @@ def extract_twice(location, target_dir, extractor1, extractor2): # extract this intermediate payload to the final target_dir try: - inner_archives = list(fileutils.resource_iter(temp_target, with_dirs=False)) + inner_archives = list(fileutils.resource_iter( + temp_target, with_dirs=False)) if not inner_archives: warnings.append(location + ': No files found in archive.') else: for extracted1_loc in inner_archives: if TRACE: - logger.debug('extract_twice: extractor2: %(extracted1_loc)r' % locals()) + logger.debug( + 'extract_twice: extractor2: %(extracted1_loc)r' % locals()) warnings.extend(extractor2(extracted1_loc, abs_target_dir)) finally: # cleanup the temporary output from extractor1 @@ -415,14 +422,17 @@ def extract_with_fallback(location, target_dir, extractor1, extractor2): try: warnings = extractor1(abs_location, temp_target1) if TRACE: - logger.debug('extract_with_fallback: temp_target1: %(temp_target1)r' % locals()) + logger.debug( + 'extract_with_fallback: temp_target1: %(temp_target1)r' % locals()) fileutils.copytree(temp_target1, abs_target_dir) except: try: - temp_target2 = str(fileutils.get_temp_dir(prefix='extractcode-extract2-')) + temp_target2 = str(fileutils.get_temp_dir( + prefix='extractcode-extract2-')) warnings = extractor2(abs_location, temp_target2) if TRACE: - logger.debug('extract_with_fallback: temp_target2: %(temp_target2)r' % locals()) + logger.debug( + 'extract_with_fallback: temp_target2: %(temp_target2)r' % locals()) fileutils.copytree(temp_target2, abs_target_dir) finally: fileutils.delete(temp_target2) @@ -446,7 +456,8 @@ def try_to_extract(location, target_dir, extractor): try: warnings = extractor(abs_location, temp_target) if TRACE: - logger.debug('try_to_extract: temp_target: %(temp_target)r' % locals()) + logger.debug( + 'try_to_extract: temp_target: %(temp_target)r' % locals()) fileutils.copytree(temp_target, abs_target_dir) except: return warnings @@ -685,7 +696,7 @@ def try_to_extract(location, target_dir, extractor): XzHandler = Handler( name='xz', filetypes=('xz compressed',), - mimetypes=('application/x-xz',) , + mimetypes=('application/x-xz',), extensions=('.xz',), kind=regular, extractors=[extract_xz], @@ -695,7 +706,7 @@ def try_to_extract(location, target_dir, extractor): LzmaHandler = Handler( name='lzma', filetypes=('lzma compressed',), - mimetypes=('application/x-xz',) , + mimetypes=('application/x-xz',), extensions=('.lzma',), kind=regular, extractors=[extract_lzma], @@ -705,7 +716,7 @@ def try_to_extract(location, target_dir, extractor): TarXzHandler = Handler( name='Tar xz', filetypes=('xz compressed',), - mimetypes=('application/x-xz',) , + mimetypes=('application/x-xz',), extensions=('.tar.xz', '.txz', '.tarxz',), kind=regular_nested, extractors=[extract_xz, extract_tar], @@ -715,7 +726,7 @@ def try_to_extract(location, target_dir, extractor): TarLzmaHandler = Handler( name='Tar lzma', filetypes=('lzma compressed',), - mimetypes=('application/x-lzma',) , + mimetypes=('application/x-lzma',), extensions=('tar.lzma', '.tlz', '.tarlz', '.tarlzma',), kind=regular_nested, extractors=[extract_lzma, extract_tar], @@ -726,7 +737,8 @@ def try_to_extract(location, target_dir, extractor): name='Tar gzip', filetypes=('gzip compressed',), mimetypes=('application/gzip',), - extensions=('.tgz', '.tar.gz', '.tar.gzip', '.targz', '.targzip', '.tgzip',), + extensions=('.tgz', '.tar.gz', '.tar.gzip', + '.targz', '.targzip', '.tgzip',), kind=regular_nested, extractors=[extract_tar], strict=False @@ -735,7 +747,7 @@ def try_to_extract(location, target_dir, extractor): TarLzipHandler = Handler( name='Tar lzip', filetypes=('lzip compressed',), - mimetypes=('application/x-lzip',) , + mimetypes=('application/x-lzip',), extensions=('.tar.lz', '.tar.lzip',), kind=regular_nested, extractors=[extract_lzip, extract_tar], @@ -745,7 +757,7 @@ def try_to_extract(location, target_dir, extractor): TarZstdHandler = Handler( name='Tar zstd', filetypes=('zstandard compressed',), - mimetypes=('application/x-zstd',) , + mimetypes=('application/x-zstd',), extensions=('.tar.zst', '.tar.zstd',), kind=regular_nested, extractors=[extract_zstd, extract_tar], @@ -755,7 +767,7 @@ def try_to_extract(location, target_dir, extractor): TarLz4Handler = Handler( name='Tar lz4', filetypes=('lz4 compressed',), - mimetypes=('application/x-lz4',) , + mimetypes=('application/x-lz4',), extensions=('.tar.lz4',), kind=regular_nested, extractors=[extract_lz4, extract_tar], @@ -788,7 +800,7 @@ def try_to_extract(location, target_dir, extractor): LzipHandler = Handler( name='lzip', filetypes=('lzip compressed',), - mimetypes=('application/x-lzip',) , + mimetypes=('application/x-lzip',), extensions=('.lzip',), kind=regular, extractors=[extract_lzip], @@ -798,7 +810,7 @@ def try_to_extract(location, target_dir, extractor): ZstdHandler = Handler( name='zstd', filetypes=('zstandard compressed',), - mimetypes=('application/x-zstd',) , + mimetypes=('application/x-zstd',), extensions=('.zst', '.zstd',), kind=regular_nested, extractors=[extract_zstd], @@ -808,7 +820,7 @@ def try_to_extract(location, target_dir, extractor): Lz4Handler = Handler( name='lz4', filetypes=('lz4 compressed',), - mimetypes=('application/x-lz4',) , + mimetypes=('application/x-lz4',), extensions=('.lz4',), kind=regular_nested, extractors=[extract_lz4], diff --git a/src/extractcode/cli.py b/src/extractcode/cli.py index 1afccaf..e8f6a5f 100644 --- a/src/extractcode/cli.py +++ b/src/extractcode/cli.py @@ -3,22 +3,21 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # +from extractcode.api import extract_archives +from commoncode.text import toascii +from commoncode import filetype +from commoncode import fileutils +from commoncode import cliutils import os import functools import click click.disable_unicode_literals_warning = True -from commoncode import cliutils -from commoncode import fileutils -from commoncode import filetype -from commoncode.text import toascii - -from extractcode.api import extract_archives __version__ = '2021.6.2' @@ -40,7 +39,7 @@ def print_archive_formats(ctx, param, value): if not value or ctx.resilient_parsing: return - kindkey = lambda x:x.kind + def kindkey(x): return x.kind by_kind = groupby(sorted(archive_handlers, key=kindkey), key=kindkey) @@ -63,11 +62,12 @@ def print_archive_formats(ctx, param, value): info_text = ''' ExtractCode is a mostly universal archive and compressed files extractor, with a particular focus on code archives. -Visit https://aboutcode.org and https://github.com/nexB/extractcode/ for support and download. +Visit https://aboutcode.org and https://github.com/aboutcode-org/extractcode/ for support and download. ''' -notice_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'NOTICE') +notice_path = os.path.join(os.path.abspath( + os.path.dirname(__file__)), 'NOTICE') notice_text = open(notice_path).read() @@ -111,13 +111,11 @@ class ExtractCommand(cliutils.BaseCommand): @click.command(name='extractcode', epilog=epilog_text, cls=ExtractCommand) @click.pass_context - @click.argument( 'input', metavar='', type=click.Path(exists=True, readable=True), ) - @click.option( '--verbose', is_flag=True, @@ -144,12 +142,10 @@ class ExtractCommand(cliutils.BaseCommand): multiple=True, help='Ignore files/directories matching this glob pattern.', ) - @click.option( '--all-formats', is_flag=True, - help= - 'Extract archives from all known formats. ' + help='Extract archives from all known formats. ' 'The default is to extract only the common format of these kinds: ' '"regular", "regular_nested" and "package". ' 'To show all supported formats use the option --list-formats .', @@ -245,7 +241,8 @@ def display_extract_summary(): source = fileutils.as_posixpath(xev.source) if not isinstance(source, str): - source = toascii(source, translit=True).decode('utf-8', 'replace') + source = toascii(source, translit=True).decode( + 'utf-8', 'replace') source = get_relative_path( path=source, @@ -294,7 +291,7 @@ def display_extract_summary(): with cliutils.progressmanager( extractibles, - item_show_func=extract_event, + item_show_func=extract_event, verbose=verbose ) as extraction_events: @@ -329,4 +326,3 @@ def get_relative_path(path, len_base_path, base_is_dir): rel_path = fileutils.file_name(path) return rel_path.lstrip('/') - diff --git a/src/extractcode/extract.py b/src/extractcode/extract.py index 8c547f2..ace03f5 100644 --- a/src/extractcode/extract.py +++ b/src/extractcode/extract.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -165,9 +165,11 @@ def extract_files( ``ignore_pattern`` is a list of glob patterns to ignore. """ - ignored = partial(ignore.is_ignored, ignores=ignore.default_ignores, unignores={}) + ignored = partial(ignore.is_ignored, + ignores=ignore.default_ignores, unignores={}) if TRACE: - logger.debug('extract:start: %(location)r recurse: %(recurse)r\n' % locals()) + logger.debug( + 'extract:start: %(location)r recurse: %(recurse)r\n' % locals()) abs_location = abspath(expanduser(location)) for top, dirs, files in fileutils.walk(abs_location, ignored): @@ -214,12 +216,14 @@ def extract_files( kinds=kinds, ): if TRACE: - logger.debug('extract:walk:extraction event: %(xevent)r' % locals()) + logger.debug( + 'extract:walk:extraction event: %(xevent)r' % locals()) yield xevent if recurse: if TRACE: - logger.debug('extract:walk: recursing on target: %(target)r' % locals()) + logger.debug( + 'extract:walk: recursing on target: %(target)r' % locals()) for xevent in extract( location=target, kinds=kinds, @@ -227,7 +231,8 @@ def extract_files( ignore_pattern=ignore_pattern, ): if TRACE: - logger.debug('extract:walk:recurse:extraction event: %(xevent)r' % locals()) + logger.debug( + 'extract:walk:recurse:extraction event: %(xevent)r' % locals()) yield xevent diff --git a/src/extractcode/libarchive2.py b/src/extractcode/libarchive2.py index 988cd3e..8d62845 100644 --- a/src/extractcode/libarchive2.py +++ b/src/extractcode/libarchive2.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -128,7 +128,7 @@ def load_lib(): f'OR set the {EXTRACTCODE_LIBARCHIVE_PATH_ENVVAR} environment variable. ' 'OR install libarchive as a system package. ' 'OR ensure libarchive is available in the system PATH.' - ) + ) return command.load_shared_library(dll_loc) @@ -203,7 +203,8 @@ def extract(location, target_dir, skip_symlinks=True): if TRACE: logger.debug(' writing.....') - _target_path = entry.write(abs_target_dir, transform_path=partial(paths.safe_path, preserve_spaces=True)) + _target_path = entry.write(abs_target_dir, transform_path=partial( + paths.safe_path, preserve_spaces=True)) return warnings @@ -785,7 +786,8 @@ def errcheck(rc, archive_func, args, null=False): """ # int archive_read_data_block(struct archive *, const void **buff, size_t *len, off_t *offset); read_entry_data_block = libarchive.archive_read_data_block -read_entry_data_block.argtypes = [c_void_p, POINTER(c_void_p), POINTER(c_size_t), POINTER(c_longlong)] +read_entry_data_block.argtypes = [c_void_p, POINTER( + c_void_p), POINTER(c_size_t), POINTER(c_longlong)] read_entry_data_block.restype = c_int read_entry_data_block.errcheck = errcheck diff --git a/src/extractcode/patch.py b/src/extractcode/patch.py index 3588695..6aa746e 100644 --- a/src/extractcode/patch.py +++ b/src/extractcode/patch.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -52,7 +52,8 @@ def extract(location, target_dir): # make the path safe to use as a subfile path # ensure this a good and clean posix relative path - patch_subfile_path = paths.safe_path(patch_subfile_path, preserve_spaces=True) + patch_subfile_path = paths.safe_path( + patch_subfile_path, preserve_spaces=True) # create directories parent_dir = posixpath.dirname(patch_subfile_path) diff --git a/src/extractcode/sevenzip.py b/src/extractcode/sevenzip.py index 4ecc782..5d597a5 100644 --- a/src/extractcode/sevenzip.py +++ b/src/extractcode/sevenzip.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -20,7 +20,7 @@ import attr -from commoncode import command +from commoncode import command from commoncode import fileutils from commoncode import paths from commoncode.system import is_case_sensitive_fs @@ -105,7 +105,7 @@ def get_command_location(_cache=[]): f'OR set the {EXTRACTCODE_7ZIP_PATH_ENVVAR} environment variable. ' 'OR install 7zip as a system package. ' 'OR ensure 7zip is available in the system PATH.' - ) + ) _cache.append(cmd_loc) return cmd_loc @@ -467,12 +467,14 @@ def extract_file_by_file( errors[entry.path] = 'No file name extracted.' continue - safe_path = paths.safe_path(entry.path, posix=True, preserve_spaces=True) + safe_path = paths.safe_path( + entry.path, posix=True, preserve_spaces=True) target_file_loc = os.path.join(target_dir, safe_path) target_file_dir = os.path.dirname(target_file_loc) fileutils.create_dir(target_file_dir) - unique_target_file_loc = extractcode.new_name(target_file_loc, is_dir=False) + unique_target_file_loc = extractcode.new_name( + target_file_loc, is_dir=False) if TRACE: logger.debug('extract: unique_target_file_loc: from {} to {}'.format( @@ -607,7 +609,8 @@ def parse_7z_listing(location): text = text.replace('\r\n', '\n') if TRACE: - logger.debug('parse_7z_listing: initial text: type: ' + repr(type(text))) + logger.debug('parse_7z_listing: initial text: type: ' + + repr(type(text))) print('--------------------------------------') print(text) print('--------------------------------------') @@ -657,7 +660,7 @@ def parse_7z_listing(location): first_line = '\n'.join([first_line, second_line]) lines[0] = first_line - dangling_lines = [line for line in lines if key_value_sep not in line] + dangling_lines = [line for line in lines if key_value_sep not in line] entry_errors = [] if dangling_lines: emsg = ( @@ -667,7 +670,7 @@ def parse_7z_listing(location): entry_errors.append(emsg) entry_attributes = {} - key_lines = [line for line in lines if key_value_sep in line] + key_lines = [line for line in lines if key_value_sep in line] for line in key_lines: k, _, v = line.partition(key_value_sep) k = k.strip() diff --git a/src/extractcode/uncompress.py b/src/extractcode/uncompress.py index 143e336..5769e8c 100644 --- a/src/extractcode/uncompress.py +++ b/src/extractcode/uncompress.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -42,7 +42,8 @@ def uncompress(location, target_dir, decompressor, suffix=EXTRACT_SUFFIX): tmp_loc, warnings = uncompress_file(location, decompressor) - target_location = os.path.join(target_dir, os.path.basename(location) + suffix) + target_location = os.path.join( + target_dir, os.path.basename(location) + suffix) if os.path.exists(target_location): fileutils.delete(target_location) shutil.move(tmp_loc, target_location) diff --git a/src/extractcode/vmimage.py b/src/extractcode/vmimage.py index 2ce0ea7..39b48a7 100644 --- a/src/extractcode/vmimage.py +++ b/src/extractcode/vmimage.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -45,15 +45,15 @@ 'Unable to extract virtual machine image: you need to install the ' 'guestfish tool from libguestfs and extra FS drivers as needed. ' 'See the ExtractCode README.rst at ' - 'https://github.com/nexB/extractcode/blob/main/README.rst ' + 'https://github.com/aboutcode-org/extractcode/blob/main/README.rst ' 'and https://libguestfs.org/ for details.' ) GUESTFISH_KERNEL_NOT_READABLE = ( -'''libguestfs requires the kernel executable to be readable. + '''libguestfs requires the kernel executable to be readable. This is the case by default on most Linux distributions except on Ubuntu. Please follow the ExtractCode installation instructions in the README.rst at: -https://github.com/nexB/extractcode/blob/main/README.rst ' +https://github.com/aboutcode-org/extractcode/blob/main/README.rst ' ''') EXTRACTCODE_GUESTFISH_PATH_ENVVAR = 'EXTRACTCODE_GUESTFISH_PATH' @@ -162,7 +162,7 @@ def listfs(self, skip_partitions=('swap',)): args = [ '--ro', f'--format={self.image_format}', - '--add' , self.location, + '--add', self.location, 'run', ':', 'list-filesystems', ] diff --git a/tests/extractcode_assert_utils.py b/tests/extractcode_assert_utils.py index 1b3ac34..df67e79 100644 --- a/tests/extractcode_assert_utils.py +++ b/tests/extractcode_assert_utils.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -84,7 +84,8 @@ def check_files(test_dir, expected, regen=False): except AssertionError: files = [ 'test_dir: file://{}'.format(test_dir), - 'expected: file://{}'.format(expected if expected_is_json_file else ''), + 'expected: file://{}'.format( + expected if expected_is_json_file else ''), ] assert result == files + expected_content @@ -257,4 +258,4 @@ def assertExceptionContains(self, text, callableObj, *args, **kwargs): ) else: raise self.failureException( - 'Exception containing %(text)r not raised' % locals()) + 'Exception containing %(text)r not raised' % locals()) diff --git a/tests/test_archive.py b/tests/test_archive.py index 64f17ce..652721e 100644 --- a/tests/test_archive.py +++ b/tests/test_archive.py @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -160,7 +160,8 @@ def test_get_extractor_with_kinds_rpm(self): def test_get_extractor_with_kinds_rpm_2(self): test_file = 'archive/rpm/elfinfo-1.0-1.fc9.src.rpm' - kinds = (archive.regular, archive.file_system, archive.docs, archive.package) + kinds = (archive.regular, archive.file_system, + archive.docs, archive.package) expected = [sevenzip.extract, libarchive2.extract] self.check_get_extractors(test_file, expected, kinds) @@ -195,7 +196,8 @@ def test_get_extractor_for_graffle_docs(self): self.check_get_extractors(test_file, expected, (archive.docs,)) expected = [] - self.check_get_extractors(test_file, expected, kinds=extractcode.default_kinds) + self.check_get_extractors( + test_file, expected, kinds=extractcode.default_kinds) def test_get_extractor_for_compressed_svgz_docs(self): test_file = 'archive/svgz/insert-emptyframe.svgz' @@ -204,32 +206,39 @@ def test_get_extractor_for_compressed_svgz_docs(self): self.check_get_extractors(test_file, expected, (archive.docs,)) expected = [] - self.check_get_extractors(test_file, expected, kinds=extractcode.default_kinds) + self.check_get_extractors( + test_file, expected, kinds=extractcode.default_kinds) def test_get_extractor_qcow2(self): test_file = self.extract_test_tar('vmimage/foobar.qcow2.tar.gz') test_file = str(Path(test_file) / 'foobar.qcow2') expected = [] - self.check_get_extractors(test_file, expected, kinds=extractcode.default_kinds) + self.check_get_extractors( + test_file, expected, kinds=extractcode.default_kinds) expected = [archive.extract_vm_image] self.check_get_extractors(test_file, expected, kinds=()) - self.check_get_extractors(test_file, expected, kinds=(extractcode.file_system,)) - self.check_get_extractors(test_file, expected, kinds=extractcode.all_kinds) + self.check_get_extractors( + test_file, expected, kinds=(extractcode.file_system,)) + self.check_get_extractors( + test_file, expected, kinds=extractcode.all_kinds) def test_get_extractor_for_dia(self): test_file = self.get_test_loc('archive/dia/dia.dia', copy=True) expected = [archive.uncompress_gzip] - self.check_get_extractors(test_file, expected, kinds=extractcode.all_kinds) + self.check_get_extractors( + test_file, expected, kinds=extractcode.all_kinds) expected = [] - self.check_get_extractors(test_file, expected, kinds=extractcode.default_kinds) + self.check_get_extractors( + test_file, expected, kinds=extractcode.default_kinds) def test_get_handlers(self): test_data = [ - ('archive/deb/adduser_3.112ubuntu1_all.deb', ['Tar', 'Debian package']), + ('archive/deb/adduser_3.112ubuntu1_all.deb', + ['Tar', 'Debian package']), ('archive/rpm/elfinfo-1.0-1.fc9.src.rpm', ['RPM package']), ('archive/ar/liby.a', ['ar archive', 'Static Library']), ('archive/tar/tarred.tar', ['Tar']), @@ -246,14 +255,20 @@ def test_get_handlers(self): def test_score_handlers(self): test_data = [ - ('archive/deb/adduser_3.112ubuntu1_all.deb', [(31, 'Debian package'), (11, 'Tar')]), + ('archive/deb/adduser_3.112ubuntu1_all.deb', + [(31, 'Debian package'), (11, 'Tar')]), ('archive/rpm/elfinfo-1.0-1.fc9.src.rpm', [(32, 'RPM package')]), - ('archive/ar/liby.a', [(31, 'Static Library'), (17, 'ar archive')]), + ('archive/ar/liby.a', + [(31, 'Static Library'), (17, 'ar archive')]), ('archive/tar/tarred.tar', [(29, 'Tar')]), - ('archive/tar/gem/panchira-0.1.1.gem', [(31, 'Ruby Gem package'), (17, 'Tar')]), - ('archive/tbz/tarred_bzipped.tar.bz2', [(30, 'Tar bzip2'), (29, 'bzip2')]), - ('archive/tbz/tarred_bzipped.bz', [(29, 'bzip2'), (18, 'Tar bzip2')]), - ('archive/tgz/tarred_gzipped.gz', [(29, 'Gzip'), (18, 'Tar gzip')]), + ('archive/tar/gem/panchira-0.1.1.gem', + [(31, 'Ruby Gem package'), (17, 'Tar')]), + ('archive/tbz/tarred_bzipped.tar.bz2', + [(30, 'Tar bzip2'), (29, 'bzip2')]), + ('archive/tbz/tarred_bzipped.bz', + [(29, 'bzip2'), (18, 'Tar bzip2')]), + ('archive/tgz/tarred_gzipped.gz', + [(29, 'Gzip'), (18, 'Tar gzip')]), ('archive/gzip/mysql-arch.ARZ', [(29, 'Gzip'), (18, 'Tar gzip')]), ] @@ -261,7 +276,8 @@ def test_score_handlers(self): test_loc = self.get_test_loc(test_file) handlers = archive.get_handlers(test_loc) scored = archive.score_handlers(handlers) - assert expected == sorted([(h[0], h[1].name) for h in scored], reverse=True) + assert expected == sorted([(h[0], h[1].name) + for h in scored], reverse=True) def test_no_handler_is_selected_for_a_non_archive(self): # failed because of libmagic bug: http://bugs.gw.com/view.php?id=467 @@ -269,23 +285,29 @@ def test_no_handler_is_selected_for_a_non_archive(self): test_loc = self.get_test_loc('archive/not_archive/hashfile') assert [] == list(archive.get_handlers(test_loc)) assert None == archive.get_extractor(test_loc) - assert None == archive.get_extractor(test_loc, kinds=extractcode.all_kinds) - assert not archive.should_extract(test_loc, kinds=extractcode.default_kinds) + assert None == archive.get_extractor( + test_loc, kinds=extractcode.all_kinds) + assert not archive.should_extract( + test_loc, kinds=extractcode.default_kinds) def test_no_handler_is_selected_for_a_non_archive2(self): # FWIW there is a related libmagic bug: http://bugs.gw.com/view.php?id=473 test_loc = self.get_test_loc('archive/not_archive/wildtest.txt') assert [] == list(archive.get_handlers(test_loc)) assert None == archive.get_extractor(test_loc) - assert None == archive.get_extractor(test_loc, kinds=extractcode.all_kinds) - assert not archive.should_extract(test_loc, kinds=extractcode.default_kinds) + assert None == archive.get_extractor( + test_loc, kinds=extractcode.all_kinds) + assert not archive.should_extract( + test_loc, kinds=extractcode.default_kinds) def test_no_handler_is_selected_for_a_non_archive3(self): test_loc = self.get_test_loc('archive/not_archive/savetransfer.c') assert [] == list(archive.get_handlers(test_loc)) assert None == archive.get_extractor(test_loc) - assert None == archive.get_extractor(test_loc, kinds=extractcode.all_kinds) - assert not archive.should_extract(test_loc, kinds=extractcode.default_kinds) + assert None == archive.get_extractor( + test_loc, kinds=extractcode.all_kinds) + assert not archive.should_extract( + test_loc, kinds=extractcode.default_kinds) def test_7zip_extract_can_extract_to_relative_paths(self): # The setup is a tad complex because we want to have a relative dir @@ -296,13 +318,16 @@ def test_7zip_extract_can_extract_to_relative_paths(self): import shutil from extractcode.sevenzip import extract - test_file = self.get_test_loc('archive/relative_path/basic.zip', copy=True) + test_file = self.get_test_loc( + 'archive/relative_path/basic.zip', copy=True) project_tmp = join(project_root, 'tmp') fileutils.create_dir(project_tmp) project_root_abs = abspath(project_root) - test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/') - test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/') + test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root_abs, '').strip('\\/') + test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root_abs, '').strip('\\/') shutil.copy(test_file, test_src_dir) test_src_file = join(test_src_dir, 'basic.zip') result = list(extract(test_src_file, test_tgt_dir)) @@ -341,7 +366,8 @@ def test_extract_targz_broken(self): test_file = self.get_test_loc('archive/tgz/broken.tar.gz') test_dir = self.get_temp_dir() expected = Exception('Unrecognized archive format') - self.assertRaisesInstance(expected, archive.extract_tar, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_tar, test_file, test_dir) def test_extract_targz_with_absolute_path(self): non_result = '/tmp/subdir' @@ -393,7 +419,8 @@ def test_extract_targz_with_mixed_case_and_symlink(self): test_dir = self.get_temp_dir() result = archive.extract_tar(test_file, test_dir) assert [] == result - exp_file = self.get_test_loc('archive/tgz/mixed_case_and_symlink.tgz.expected.json') + exp_file = self.get_test_loc( + 'archive/tgz/mixed_case_and_symlink.tgz.expected.json') check_files(test_dir, exp_file, regen=False) def test_extract_targz_symlinks(self): @@ -415,7 +442,8 @@ def test_extract_targz_symlinks(self): def test_extract_targz_from_apache_should_not_return_errors(self): # from http://archive.apache.org/dist/commons/logging/source/commons-logging-1.1.2-src.tar.gz # failed with ReadError('not a bzip2 file',) - test_file = self.get_test_loc('archive/tgz/commons-logging-1.1.2-src.tar.gz') + test_file = self.get_test_loc( + 'archive/tgz/commons-logging-1.1.2-src.tar.gz') test_dir = self.get_temp_dir() extractor = archive.get_extractor(test_file) assert archive.extract_tar == extractor @@ -471,13 +499,15 @@ def test_uncompress_gzip_with_leading_data(self): test_file = self.get_test_loc('archive/gzip/leading_data.gz') test_dir = self.get_temp_dir() expected = Exception('Not a gzipped file') - self.assertRaisesInstance(expected, archive.uncompress_gzip, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.uncompress_gzip, test_file, test_dir) def test_uncompress_gzip_with_random_data(self): test_file = self.get_test_loc('archive/gzip/random_binary.data') test_dir = self.get_temp_dir() expected = Exception('Not a gzipped file') - self.assertRaisesInstance(expected, archive.uncompress_gzip, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.uncompress_gzip, test_file, test_dir) def test_uncompress_gzip_with_backslash_in_path(self): # weirdly enough, gzip keeps the original path/name @@ -519,17 +549,20 @@ def test_extract_tar_bz2_basic_bz(self): assert os.path.exists(result) def test_extract_tar_bz2_with_trailing_data__and_wrong_extension(self): - test_file = self.get_test_loc('archive/tbz/single_file_trailing_data.tar.gz') + test_file = self.get_test_loc( + 'archive/tbz/single_file_trailing_data.tar.gz') test_dir = self.get_temp_dir() archive.extract_tar(test_file, test_dir) result = os.path.join(test_dir, 'a.txt') assert os.path.exists(result) def test_extract_tar_bz2_broken(self): - test_file = self.get_test_loc('archive/tbz/tarred_bzipped_broken.tar.bz2') + test_file = self.get_test_loc( + 'archive/tbz/tarred_bzipped_broken.tar.bz2') test_dir = self.get_temp_dir() expected = Exception('bzip decompression failed') - self.assertRaisesInstance(expected, archive.extract_tar, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_tar, test_file, test_dir) def test_extract_tar_bz2_absolute_path(self): assert not os.path.exists('/tmp/subdir') @@ -550,14 +583,16 @@ def test_extract_tar_bz2_relative_path(self): tar.add('b.txt', '../folder/subfolder/b_subfolder.txt') tar.close() """ - test_file = self.get_test_loc('archive/tbz/bz2withtar_relative.tar.bz2') + test_file = self.get_test_loc( + 'archive/tbz/bz2withtar_relative.tar.bz2') test_dir = self.get_temp_dir() archive.extract_tar(test_file, test_dir) non_result = os.path.join(test_dir, '../a_parent_folder.txt') assert not os.path.exists(non_result) - result = os.path.join(test_dir, 'dotdot/folder/subfolder/b_subfolder.txt') + result = os.path.join( + test_dir, 'dotdot/folder/subfolder/b_subfolder.txt') assert os.path.exists(result) result = os.path.join(test_dir, 'dotdot', 'a_parent_folder.txt') assert os.path.exists(result) @@ -570,10 +605,12 @@ def test_extract_tar_bz2_iproute(self): assert os.path.exists(result) def test_extract_tar_bz2_multistream(self): - test_file = self.get_test_loc('archive/tbz/bzip2_multistream/example-file.csv.tar.bz2') + test_file = self.get_test_loc( + 'archive/tbz/bzip2_multistream/example-file.csv.tar.bz2') test_dir = self.get_temp_dir() archive.extract_tar(test_file, test_dir) - expected = self.get_test_loc('archive/tbz/bzip2_multistream/example-file.csv') + expected = self.get_test_loc( + 'archive/tbz/bzip2_multistream/example-file.csv') result = os.path.join(test_dir, 'example-file.csv') assert open(expected, 'rb').read() == open(result, 'rb').read() @@ -588,17 +625,20 @@ def test_uncompress_bzip2_basic(self): assert os.path.exists(result) def test_uncompress_bzip2_with_trailing_data(self): - test_file = self.get_test_loc('archive/bz2/single_file_trailing_data.bz2') + test_file = self.get_test_loc( + 'archive/bz2/single_file_trailing_data.bz2') test_dir = self.get_temp_dir() archive.uncompress_bzip2(test_file, test_dir) - result = os.path.join(test_dir, 'single_file_trailing_data.bz2-extract') + result = os.path.join( + test_dir, 'single_file_trailing_data.bz2-extract') assert os.path.exists(result) def test_uncompress_bzip2_broken(self): test_file = self.get_test_loc('archive/bz2/bz2_not_tarred_broken.bz2') test_dir = self.get_temp_dir() expected = Exception('Invalid data stream') - self.assertRaisesInstance(expected, archive.uncompress_bzip2, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.uncompress_bzip2, test_file, test_dir) def test_uncompress_bzip2_with_invalid_path(self): test_file = self.get_test_loc('archive/bz2/bz_invalidpath.bz2') @@ -608,10 +648,12 @@ def test_uncompress_bzip2_with_invalid_path(self): assert os.path.exists(result) def test_uncompress_bzip2_multistream(self): - test_file = self.get_test_loc('archive/bz2/bzip2_multistream/example-file.csv.bz2') + test_file = self.get_test_loc( + 'archive/bz2/bzip2_multistream/example-file.csv.bz2') test_dir = self.get_temp_dir() archive.uncompress_bzip2(test_file, test_dir) - expected = self.get_test_loc('archive/bz2/bzip2_multistream/expected.csv') + expected = self.get_test_loc( + 'archive/bz2/bzip2_multistream/expected.csv') result = os.path.join(test_dir, 'example-file.csv.bz2-extract') assert open(expected, 'rb').read() == open(result, 'rb').read() @@ -619,15 +661,17 @@ def test_uncompress_bzip2_multistream(self): class TestSevenzipBz2(BaseArchiveTestCase): def test_sevenzip_extract_can_handle_bz2_multistream_differently(self): - test_file = self.get_test_loc('archive/bz2/bzip2_multistream/example-file.csv.bz2') + test_file = self.get_test_loc( + 'archive/bz2/bzip2_multistream/example-file.csv.bz2') test_dir = self.get_temp_dir() sevenzip.extract(test_file, test_dir) - expected = self.get_test_loc('archive/bz2/bzip2_multistream/expected.csv') + expected = self.get_test_loc( + 'archive/bz2/bzip2_multistream/expected.csv') # the extraction dir is not created with suffix by 7z result = os.path.join(test_dir, 'example-file.csv') expected_extracted = open(expected, 'rb').read() expected_result = open(result, 'rb').read() - assert expected_extracted == expected_result + assert expected_extracted == expected_result class TestShellArchives(BaseArchiveTestCase): @@ -724,11 +768,12 @@ def test_extract_zip_with_relative_path_using_default_function(self): # f.write('/tmp/a.txt', ('../' * 12) + ('sub/' * 12) + 'a_parent_folder_in_sub_3.txt') # f.close() - test_file = self.get_test_loc('archive/zip/relative_parent_folders.zip') + test_file = self.get_test_loc( + 'archive/zip/relative_parent_folders.zip') test_dir = self.get_temp_dir() archive.extract_zip(test_file, test_dir) - abs_path = os.path.join(test_dir , '../a_parent_folder.txt') + abs_path = os.path.join(test_dir, '../a_parent_folder.txt') assert not os.path.exists(abs_path) result = self.collect_extracted_path(test_dir) @@ -745,17 +790,20 @@ def test_extract_zip_with_relative_path_using_default_function(self): assert expected == result def test_extract_zip_with_relative_path_using_libarchive(self): - test_file = self.get_test_loc('archive/zip/relative_parent_folders.zip') + test_file = self.get_test_loc( + 'archive/zip/relative_parent_folders.zip') test_dir = self.get_temp_dir() result = libarchive2.extract(test_file, test_dir) assert [] == result - abs_path = os.path.join(test_dir , '../a_parent_folder.txt') + abs_path = os.path.join(test_dir, '../a_parent_folder.txt') assert not os.path.exists(abs_path) - result = os.path.join(test_dir, 'dotdot/folder/subfolder/b_subfolder.txt') + result = os.path.join( + test_dir, 'dotdot/folder/subfolder/b_subfolder.txt') assert os.path.exists(result) result = os.path.join(test_dir, 'dotdot/a_parent_folder.txt') assert os.path.exists(result) - result = os.path.join(test_dir, 'dotdot/dotdot/another_folder/b_two_root.txt') + result = os.path.join( + test_dir, 'dotdot/dotdot/another_folder/b_two_root.txt') assert os.path.exists(result) expected_deeply_nested_relative_path = [ @@ -1024,7 +1072,8 @@ def test_extract_zip_with_backslash_in_path_3(self): test_file = self.get_test_loc('archive/zip/backslash/boo-0.3-src.zip') test_dir = self.get_temp_dir() archive.extract_zip(test_file, test_dir) - result = os.path.join(test_dir, 'src/Boo.Lang.Compiler/TypeSystem/InternalCallableType.cs') + result = os.path.join( + test_dir, 'src/Boo.Lang.Compiler/TypeSystem/InternalCallableType.cs') assert os.path.exists(result) def test_get_best_handler_nuget_is_selected_over_zip(self): @@ -1033,12 +1082,14 @@ def test_get_best_handler_nuget_is_selected_over_zip(self): assert archive.NugetHandler == handler def test_get_best_handler_nuget_is_selected_over_zip2(self): - test_file = self.get_test_loc('archive/zip/exceptionhero.javascript.1.0.5.nupkg') + test_file = self.get_test_loc( + 'archive/zip/exceptionhero.javascript.1.0.5.nupkg') handler = archive.get_best_handler(test_file) assert archive.NugetHandler == handler def test_get_best_handler_nuget_is_selected_over_zip3(self): - test_file = self.get_test_loc('archive/zip/javascript-fastclass.1.1.729.121805.nupkg') + test_file = self.get_test_loc( + 'archive/zip/javascript-fastclass.1.1.729.121805.nupkg') handler = archive.get_best_handler(test_file) assert archive.NugetHandler == handler @@ -1058,7 +1109,8 @@ def test_extract_zip_with_unicode_path_should_extract_without_error(self): assert os.listdir(test_dir) def test_extract_zip_can_extract_zip_with_directory_not_marked_with_trailing_slash(self): - test_file = self.get_test_loc('archive/zip/directory-with-no-trailing-slash.zip') + test_file = self.get_test_loc( + 'archive/zip/directory-with-no-trailing-slash.zip') test_dir = self.get_temp_dir() result = archive.extract_zip(test_file, test_dir) assert [] == result @@ -1091,7 +1143,8 @@ def test_extract_tar_absolute_path(self): archive.extract_tar(test_file, test_dir) assert not os.path.exists(non_result) - result = os.path.join(test_dir, 'home/li/Desktop/absolute_folder/absolute_file') + result = os.path.join( + test_dir, 'home/li/Desktop/absolute_folder/absolute_file') assert os.path.exists(result) def test_extract_tar_with_absolute_path2(self): @@ -1160,7 +1213,8 @@ def test_extract_python_testtar_tar_archive_with_special_files(self): # https://hg.python.org/cpython/raw-file/bff88c866886/Lib/test/testtar.tar test_dir = self.get_temp_dir() result = archive.extract_tar(test_file, test_dir) - expected_warnings = [u"'pax/bad-pax-äöü': \nPathname can't be converted from UTF-8 to current locale."] + expected_warnings = [ + u"'pax/bad-pax-äöü': \nPathname can't be converted from UTF-8 to current locale."] assert sorted(expected_warnings) == sorted(result) @@ -1209,19 +1263,22 @@ def test_extract_rubygem(self): class TestDebian(BaseArchiveTestCase): def test_extract_deb_package_1(self): - test_file = self.get_test_loc('archive/deb/adduser_3.112ubuntu1_all.deb') + test_file = self.get_test_loc( + 'archive/deb/adduser_3.112ubuntu1_all.deb') test_dir = self.get_temp_dir() archive.extract_ar(test_file, test_dir) check_size(110198, os.path.join(test_dir, 'data.tar.gz')) def test_extract_deb_package_2(self): - test_file = self.get_test_loc('archive/deb/adduser_3.113+nmu3ubuntu3_all.deb') + test_file = self.get_test_loc( + 'archive/deb/adduser_3.113+nmu3ubuntu3_all.deb') test_dir = self.get_temp_dir() archive.extract_ar(test_file, test_dir) check_size(158441, os.path.join(test_dir, 'data.tar.gz')) def test_get_best_handler_deb_package_is_an_archive(self): - test_file = self.get_test_loc('archive/deb/libjama-dev_1.2.4-2_all.deb') + test_file = self.get_test_loc( + 'archive/deb/libjama-dev_1.2.4-2_all.deb') handler = archive.get_best_handler(test_file) assert archive.DebHandler == handler @@ -1413,7 +1470,8 @@ def test_extract_ar_with_permissions_7z(self): test_file = self.get_test_loc('archive/ar/winlib/zlib.lib') test_dir = self.get_temp_dir() result = sevenzip.extract(test_file, test_dir) - expected = ['1.txt', '1.zlib.pyd', '2.txt', '2.zlib.pyd', '3.zlib.pyd', '4.zlib.pyd'] + expected = ['1.txt', '1.zlib.pyd', '2.txt', + '2.zlib.pyd', '3.zlib.pyd', '4.zlib.pyd'] check_files(test_dir, expected) assert [] == result @@ -1424,7 +1482,8 @@ def test_extract_ar_with_permissions(self): # with 7zip # expected = ['1.txt', '1.zlib.pyd', '2.txt', '2.zlib.pyd', '3.zlib.pyd', '4.zlib.pyd'] # with libarchive - expected = ['dot', 'dot_1', 'zlib.pyd', 'zlib_1.pyd', 'zlib_2.pyd', 'zlib_3.pyd'] + expected = ['dot', 'dot_1', 'zlib.pyd', + 'zlib_1.pyd', 'zlib_2.pyd', 'zlib_3.pyd'] check_files(test_dir, expected) assert [] == result @@ -1433,14 +1492,16 @@ def test_extract_ar_with_permissions_libarchive(self): test_dir = self.get_temp_dir() result = libarchive2.extract(test_file, test_dir) assert [] == result - expected = ['dot', 'dot_1', 'zlib.pyd', 'zlib_1.pyd', 'zlib_2.pyd', 'zlib_3.pyd'] + expected = ['dot', 'dot_1', 'zlib.pyd', + 'zlib_1.pyd', 'zlib_2.pyd', 'zlib_3.pyd'] check_files(test_dir, expected) class TestCpio(BaseArchiveTestCase): def test_extract_cpio_basic(self): - test_file = self.get_test_loc('archive/cpio/elfinfo-1.0-1.fc9.src.cpio') + test_file = self.get_test_loc( + 'archive/cpio/elfinfo-1.0-1.fc9.src.cpio') test_dir = self.get_temp_dir() archive.extract_cpio(test_file, test_dir) result = os.path.join(test_dir, 'elfinfo-1.0.tar.gz') @@ -1456,7 +1517,8 @@ def test_extract_cpio_with_trailing_data(self): def test_extract_cpio_broken_7z(self): test_file = self.get_test_loc('archive/cpio/cpio_broken.cpio') test_dir = self.get_temp_dir() - self.assertRaisesInstance(Exception('CRC Failed : elfinfo-1.0.tar'), sevenzip.extract, test_file, test_dir) + self.assertRaisesInstance(Exception( + 'CRC Failed : elfinfo-1.0.tar'), sevenzip.extract, test_file, test_dir) def test_extract_cpio_broken2(self): test_file = self.get_test_loc('archive/cpio/cpio_broken.cpio') @@ -1464,7 +1526,8 @@ def test_extract_cpio_broken2(self): result = archive.extract_cpio(test_file, test_dir) expected = sorted(['elfinfo-1.0.tar.gz', 'elfinfo.spec']) assert expected == sorted(os.listdir(test_dir)) - assert ["'elfinfo.spec': \nSkipped 72 bytes before finding valid header"] == result + assert [ + "'elfinfo.spec': \nSkipped 72 bytes before finding valid header"] == result def test_extract_cpio_with_absolute_path(self): assert not os.path.exists('/tmp/subdir') @@ -1472,7 +1535,8 @@ def test_extract_cpio_with_absolute_path(self): test_file = self.get_test_loc('archive/cpio/cpio_absolute.cpio') archive.extract_cpio(test_file, test_dir) assert not os.path.exists('/tmp/subdir') - result = os.path.join(test_dir, 'home/li/Desktop/absolute_folder/absolute_file') + result = os.path.join( + test_dir, 'home/li/Desktop/absolute_folder/absolute_file') assert os.path.exists(result) def test_extract_cpio_with_relative_path(self): @@ -1534,10 +1598,12 @@ def test_extract_rpm_basic_2(self): assert os.path.exists(result) def test_extract_rpm_nested_correctly(self): - test_file = self.get_test_loc('archive/rpm/extract_once/libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.rpm') + test_file = self.get_test_loc( + 'archive/rpm/extract_once/libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.rpm') test_dir = self.get_temp_dir() archive.extract_rpm(test_file, test_dir) - result = os.path.join(test_dir, 'libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.cpio.lzma') + result = os.path.join( + test_dir, 'libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.cpio.lzma') assert os.path.exists(result) def test_extract_rpm_with_trailing_data(self): @@ -1660,8 +1726,10 @@ def test_extract_twice_can_extract_to_relative_paths(self): project_tmp = join(project_root, 'tmp') fileutils.create_dir(project_tmp) project_root_abs = abspath(project_root) - test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/') - test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/') + test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root_abs, '').strip('\\/') + test_tgt_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root_abs, '').strip('\\/') shutil.copy(test_file, test_src_dir) test_src_file = join(test_src_dir, 'xz-compressed-cpio.rpm') @@ -1690,7 +1758,8 @@ def test_extract_rar_with_trailing_data(self): test_file = self.get_test_loc('archive/rar/rar_trailing.rar') test_dir = self.get_temp_dir() expected = Exception('Unknown error') - self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_rar, test_file, test_dir) result = os.path.join(test_dir, 'd', 'b', 'a.txt') assert os.path.exists(result) @@ -1698,11 +1767,13 @@ def test_extract_rar_broken(self): test_file = self.get_test_loc('archive/rar/broken.rar') test_dir = self.get_temp_dir() expected = Exception('Header CRC error') - self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_rar, test_file, test_dir) def test_extract_rar_with_relative_path(self): # FIXME: this file may not have a real relative path - test_file = self.get_test_loc('archive/rar/rar_relative.rar', copy=True) + test_file = self.get_test_loc( + 'archive/rar/rar_relative.rar', copy=True) test_dir = self.get_temp_dir() archive.extract_rar(test_file, test_dir) result = os.path.abspath(test_file + '/../a_parent_folder.txt') @@ -1717,19 +1788,21 @@ def test_extract_rar_with_relative_path(self): def test_extract_rar_with_absolute_path(self): # FIXME: this file may not have a real absolute path assert not os.path.exists('/home/li/Desktop/zip_folder') - test_file = self.get_test_loc('archive/rar/rar_absolute.rar', copy=True) + test_file = self.get_test_loc( + 'archive/rar/rar_absolute.rar', copy=True) test_dir = self.get_temp_dir() archive.extract_rar(test_file, test_dir) assert not os.path.exists('/home/li/Desktop/absolute_folder') result = os.path.join(test_dir, 'home/li/Desktop', - 'absolute_folder/absolute_file') + 'absolute_folder/absolute_file') assert os.path.exists(result) def test_extract_rar_with_password(self): test_file = self.get_test_loc('archive/rar/rar_password.rar') test_dir = self.get_temp_dir() expected = Exception('Prefix found') - self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_rar, test_file, test_dir) def test_extract_rar_with_non_ascii_path(self): test_file = self.get_test_loc('archive/rar/non_ascii_corrupted.rar') @@ -1738,8 +1811,10 @@ def test_extract_rar_with_non_ascii_path(self): test_dir = self.get_temp_dir() # raise an exception but still extracts some expected = Exception('Prefix found') - self.assertRaisesInstance(expected, archive.extract_rar, test_file, test_dir) - result = os.path.join(test_dir, 'EdoProject_java/WebContent/WEB-INF/lib/cos.jar') + self.assertRaisesInstance( + expected, archive.extract_rar, test_file, test_dir) + result = os.path.join( + test_dir, 'EdoProject_java/WebContent/WEB-INF/lib/cos.jar') assert os.path.exists(result) @@ -1765,19 +1840,22 @@ def test_extract_7z_with_broken_archive_with7z(self): test_file = self.get_test_loc('archive/7z/corrupted7z.7z') test_dir = self.get_temp_dir() msg = 'There are data after the end of archive' - self.assertExceptionContains(msg, sevenzip.extract, test_file, test_dir) + self.assertExceptionContains( + msg, sevenzip.extract, test_file, test_dir) def test_extract_7z_with_broken_archive_does_not_fail_when_using_fallback(self): test_file = self.get_test_loc('archive/7z/corrupted7z.7z') test_dir = self.get_temp_dir() msg = 'There are data after the end of archive' - self.assertExceptionContains(msg, archive.extract_7z, test_file, test_dir) + self.assertExceptionContains( + msg, archive.extract_7z, test_file, test_dir) def test_extract_7z_with_non_existing_archive(self): test_file = 'archive/7z/I_DO_NOT_EXIST.zip' test_dir = self.get_temp_dir() msg = 'The system cannot find the path specified' - self.assertExceptionContains(msg, sevenzip.extract, test_file, test_dir) + self.assertExceptionContains( + msg, sevenzip.extract, test_file, test_dir) def test_extract_7z_with_invalid_path_using_7z(self): test_file = self.get_test_loc('archive/7z/7zip_invalidpath.7z') @@ -1820,13 +1898,15 @@ def test_extract_7z_with_password_with_7z(self): test_file = self.get_test_loc('archive/7z/7zip_password.7z') test_dir = self.get_temp_dir() expected = Exception('Password protected archive, unable to extract') - self.assertRaisesInstance(expected, sevenzip.extract, test_file, test_dir) + self.assertRaisesInstance( + expected, sevenzip.extract, test_file, test_dir) def test_extract_7z_with_password(self): test_file = self.get_test_loc('archive/7z/7zip_password.7z') test_dir = self.get_temp_dir() expected = Exception('Password protected archive, unable to extract') - self.assertRaisesInstance(expected, archive.extract_7z, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.extract_7z, test_file, test_dir) def test_extract_7zip_native_with_unicode_path_should_extract_without_error(self): test_file = self.get_test_loc('archive/7z/7zip_unicode.7z') @@ -1896,10 +1976,10 @@ def check_lzma_extract(self, extract_fun, test_file, expected): extract_dir = self.get_temp_dir() expected_file = os.path.join(extract_dir, expected) extract_fun(test_file, extract_dir) - assert os.path.exists(expected_file), ( - '%(expected_file)s file was not extracted ' - 'correctly from archive %(test_file)s' - % locals()) + assert os.path.exists(expected_file), ( + '%(expected_file)s file was not extracted ' + 'correctly from archive %(test_file)s' + % locals()) def test_extract_archive_tar_xz_1(self): test_file = 'archive/lzma_xz/texlive-core-patches-20.tar.xz' @@ -1922,15 +2002,15 @@ def test_extract_archive_tar_lzma_1(self): def test_extract_archive_tar_lzma_2(self): test_file = 'archive/lzma_xz/orionsocket-1.0.9.tar.lzma' self.check_lzma_extract(extract_fun=archive.extract_lzma, - test_file=test_file, - expected='orionsocket-1.0.9.tar') + test_file=test_file, + expected='orionsocket-1.0.9.tar') def test_extract_archive_tar_lzma_3(self): test_file = 'archive/lzma_xz/MinGW-5.1.6.exe-src.tar.lzma' expected = 'MinGW-5.1.6.exe-src.tar' self.check_lzma_extract(extract_fun=archive.extract_lzma, - test_file=test_file, - expected=expected) + test_file=test_file, + expected=expected) class TestDia(BaseArchiveTestCase): @@ -1962,25 +2042,27 @@ def test_extract_dia_broken_1(self): test_file = self.get_test_loc('archive/dia/dia_broken.dia') test_dir = self.get_temp_dir() self.assertExceptionContains('CRC check failed', - archive.uncompress_gzip, test_file, test_dir) + archive.uncompress_gzip, test_file, test_dir) def test_extract_dia_broken_2(self): test_file = self.get_test_loc('archive/dia/broken/PublisherUML.dia') test_dir = self.get_temp_dir() self.assertExceptionContains('invalid distance too far back', - archive.uncompress_gzip, test_file, test_dir) + archive.uncompress_gzip, test_file, test_dir) def test_extract_dia_broken_3(self): - test_file = self.get_test_loc('archive/dia/broken/schedulerClassDiagram.dia') + test_file = self.get_test_loc( + 'archive/dia/broken/schedulerClassDiagram.dia') test_dir = self.get_temp_dir() self.assertExceptionContains('invalid distance too far back', - archive.uncompress_gzip, test_file, test_dir) + archive.uncompress_gzip, test_file, test_dir) def test_extract_dia_broken_4(self): - test_file = self.get_test_loc('archive/dia/broken/ServletProxyGenerator.dia') + test_file = self.get_test_loc( + 'archive/dia/broken/ServletProxyGenerator.dia') test_dir = self.get_temp_dir() self.assertExceptionContains('invalid distance too far back', - archive.uncompress_gzip, test_file, test_dir) + archive.uncompress_gzip, test_file, test_dir) def test_extract_can_get_extractor_and_uncompress_dia_files(self): test_file = self.get_test_loc('archive/dia/guess/infoset-doc.dia') @@ -2148,7 +2230,8 @@ def test_extract_cbz_basic_with_weird_filename_extension(self): class TestLzip(BaseArchiveTestCase): - pytestmark = pytest.mark.skipif(on_windows, reason='FIXME: lzip does not work on Windows') + pytestmark = pytest.mark.skipif( + on_windows, reason='FIXME: lzip does not work on Windows') def test_extract_tarlzip_basic(self): test_file = self.get_test_loc('archive/lzip/sample.tar.lz') @@ -2244,7 +2327,8 @@ def check_extract_weird_names( return len_test_dir = len(test_dir) - extracted = sorted(path[len_test_dir:] for path in fileutils.resource_iter(test_dir, with_dirs=False)) + extracted = sorted(path[len_test_dir:] for path in fileutils.resource_iter( + test_dir, with_dirs=False)) extracted = [str(p) for p in extracted] extracted = [to_posix(p) for p in extracted] @@ -2290,7 +2374,8 @@ def test_extract_ar_with_weird_filenames_with_libarchive_posix(self): test_file = self.get_test_loc('archive/weird_names/weird_names.ar') test_dir = self.get_temp_dir() expected = Exception('Incorrect file header signature') - self.assertRaisesInstance(expected, libarchive2.extract, test_file, test_dir) + self.assertRaisesInstance( + expected, libarchive2.extract, test_file, test_dir) def test_extract_cpio_with_weird_filenames_with_libarchive_posix(self): test_file = self.get_test_loc('archive/weird_names/weird_names.cpio') diff --git a/tests/test_extract.py b/tests/test_extract.py index 5e35612..ab70a40 100644 --- a/tests/test_extract.py +++ b/tests/test_extract.py @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -33,7 +33,8 @@ class TestExtract(BaseArchiveTestCase): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') def test_extract_file_function(self): - test_file = self.get_test_loc('extract/basic_non_nested.tar.gz', copy=True) + test_file = self.get_test_loc( + 'extract/basic_non_nested.tar.gz', copy=True) base = fileutils.parent_directory(test_file) expected = ['a/b/a.txt', 'a/b/b.txt', 'a/c/c.txt'] cleaned_test_file = test_file.replace(base, '') @@ -53,14 +54,15 @@ def test_extract_file_function(self): target = extractcode.get_extraction_path(test_file) result = list(extract.extract_file(test_file, target)) result = [r._replace( - source=cleaned_test_file, - target=extractcode.get_extraction_path(cleaned_test_file)) - for r in result] + source=cleaned_test_file, + target=extractcode.get_extraction_path(cleaned_test_file)) + for r in result] assert expected_event == result check_files(target, expected) def test_extract_archive_non_nested(self): - test_dir = self.get_test_loc('extract/basic_non_nested.tar.gz', copy=True) + test_dir = self.get_test_loc( + 'extract/basic_non_nested.tar.gz', copy=True) expected = ( 'a/b/a.txt', 'a/b/b.txt', @@ -75,7 +77,8 @@ def test_extract_archive_non_nested(self): check_files(extractcode.get_extraction_path(test_dir), expected) def test_extract_archive_shallow_with_readonly_inside(self): - test_file = self.get_test_loc('extract/readonly/read_only.tar.gz', copy=True) + test_file = self.get_test_loc( + 'extract/readonly/read_only.tar.gz', copy=True) """ This test file was created with: import tarfile, time, datetime, io, os @@ -265,7 +268,8 @@ def test_extract_tree_recursive_replace_originals(self): 'c/a.tar.gz/a/c/c.txt', ) test_dir = self.get_test_loc('extract/tree', copy=True) - result = list(extract.extract(test_dir, recurse=True, replace_originals=True)) + result = list(extract.extract( + test_dir, recurse=True, replace_originals=True)) check_no_error(result) check_files(test_dir, expected) # again @@ -275,17 +279,22 @@ def test_extract_tree_recursive_replace_originals(self): def test_extract_with_replace_originals_does_not_fail_with_gz_with_trailing(self): expected = ('rake.1.gz',) - test_dir = self.get_test_loc('extract/replace-originals/rake.1.gz', copy=True) - result = list(extract.extract(test_dir, recurse=True, replace_originals=True)) + test_dir = self.get_test_loc( + 'extract/replace-originals/rake.1.gz', copy=True) + result = list(extract.extract( + test_dir, recurse=True, replace_originals=True)) r = result[-1] - assert r.errors and all(e.startswith('Not a gzipped file') for e in r.errors) + assert r.errors and all(e.startswith( + 'Not a gzipped file') for e in r.errors) assert not r.warnings check_files(test_dir, expected) def test_extract_with_replace_originals_does_not_fail_with_corrupted_archive(self): expected = ('issue6550.gz',) - test_dir = self.get_test_loc('extract/replace-originals/issue6550.gz', copy=True) - result = list(extract.extract(test_dir, recurse=True, replace_originals=True)) + test_dir = self.get_test_loc( + 'extract/replace-originals/issue6550.gz', copy=True) + result = list(extract.extract( + test_dir, recurse=True, replace_originals=True)) r = result[-1] assert r.errors and all(e.startswith('Error') for e in r.errors) assert not r.warnings @@ -391,14 +400,16 @@ def test_uncompress_corrupted_archive_with_zlib(self): test_file = self.get_test_loc('extract/corrupted/a.tar.gz', copy=True) test_dir = self.get_temp_dir() expected = Exception('Error -3 while decompressing') - self.assertRaisesInstance(expected, archive.uncompress_gzip, test_file, test_dir) + self.assertRaisesInstance( + expected, archive.uncompress_gzip, test_file, test_dir) def test_uncompress_corrupted_archive_with_libarchive(self): from extractcode import libarchive2 test_file = self.get_test_loc('extract/corrupted/a.tar.gz', copy=True) test_dir = self.get_temp_dir() expected = Exception('gzip decompression failed') - self.assertRaisesInstance(expected, libarchive2.extract, test_file, test_dir) + self.assertRaisesInstance( + expected, libarchive2.extract, test_file, test_dir) @pytest.mark.skipif(not on_linux, reason='Expectations are different on Windows and macOS') def test_extract_tree_with_corrupted_archives_linux(self): @@ -450,7 +461,8 @@ def test_extract_tar_with_broken_links(self): assert expected_warning == warns def test_extract_nested_tar_file_recurse_only(self): - test_file = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True) + test_file = self.get_test_loc( + 'extract/nested/nested_tars.tar.gz', copy=True) expected = [ 'nested_tars.tar.gz', 'nested_tars.tar.gz-extract/b/.svn/all-wcprops', @@ -489,7 +501,8 @@ def test_extract_nested_tar_file_recurse_only(self): check_files(test_file, expected) def test_extract_nested_tar_file_shallow_only(self): - test_dir = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True) + test_dir = self.get_test_loc( + 'extract/nested/nested_tars.tar.gz', copy=True) expected = [ 'nested_tars.tar.gz', 'nested_tars.tar.gz-extract/b/.svn/all-wcprops', @@ -522,7 +535,8 @@ def test_extract_nested_tar_file_shallow_only(self): check_files(test_dir, expected) def test_extract_nested_tar_file_shallow_then_recurse(self): - test_file = self.get_test_loc('extract/nested/nested_tars.tar.gz', copy=True) + test_file = self.get_test_loc( + 'extract/nested/nested_tars.tar.gz', copy=True) expected = [ 'nested_tars.tar.gz', 'nested_tars.tar.gz-extract/b/.svn/all-wcprops', @@ -667,7 +681,8 @@ def test_extract_nested_arch_with_corruption_should_extract_inner_archives_only_ def test_extract_directory_with_office_docs(self): test_dir = self.get_test_loc('extract/office_docs', copy=True) - result = list(extract.extract(test_dir, kinds=(extractcode.docs,), recurse=True)) + result = list(extract.extract( + test_dir, kinds=(extractcode.docs,), recurse=True)) expected = [ 'abc.docx', 'abc.docx-extract/[Content_Types].xml', @@ -781,7 +796,8 @@ def test_walk_can_be_extended_while_walking(self): self.touch(os.path.join(test_dir, 'dir', 'otherarch.gz')) allpaths = [] for top, dirs, files in self.extract_walker(test_dir): - allpaths.extend([as_posixpath(os.path.join(top, d).replace(test_dir, '')) for d in dirs + files]) + allpaths.extend([as_posixpath(os.path.join( + top, d).replace(test_dir, '')) for d in dirs + files]) expected = [ '/arch.gzextract/extracted_file', @@ -805,11 +821,13 @@ def test_extract_can_extract_to_relative_paths(self): project_tmp = join(project_root, 'tmp') fileutils.create_dir(project_tmp) project_root_abs = abspath(project_root) - test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root_abs, '').strip('\\/') + test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root_abs, '').strip('\\/') test_file = self.get_test_loc('extract/relative_path/basic.zip') shutil.copy(test_file, test_src_dir) test_src_file = join(test_src_dir, 'basic.zip') - test_tgt_dir = join(project_root, test_src_file) + extractcode.EXTRACT_SUFFIX + test_tgt_dir = join(project_root, test_src_file) + \ + extractcode.EXTRACT_SUFFIX result = list(extract.extract(test_src_file)) expected = ['c/a/a.txt', 'c/b/a.txt', 'c/c/a.txt'] check_files(test_tgt_dir, expected) @@ -869,7 +887,8 @@ def test_extract_ignore_file(self): 'gamma/gamma.zip', 'gamma/gamma.zip-extract/c.txt' ] - result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('alpha.zip',))) + result = list(extract.extract(test_dir, recurse=True, + ignore_pattern=('alpha.zip',))) check_no_error(result) check_files(test_dir, expected) @@ -888,7 +907,8 @@ def test_extract_ignore_directory(self): 'beta.tar-extract/c.txt', 'gamma/gamma.zip', ] - result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('gamma',))) + result = list(extract.extract( + test_dir, recurse=True, ignore_pattern=('gamma',))) check_no_error(result) check_files(test_dir, expected) @@ -907,7 +927,8 @@ def test_extract_ignore_pattern(self): 'gamma/gamma.zip', 'gamma/gamma.zip-extract/c.txt' ] - result = list(extract.extract(test_dir, recurse=True, ignore_pattern=('b*.zip',))) + result = list(extract.extract( + test_dir, recurse=True, ignore_pattern=('b*.zip',))) check_no_error(result) check_files(test_dir, expected) @@ -972,8 +993,10 @@ def test_extract_file_works_with_all_kinds(self): ] cleaned_test_file = test_dir.replace(base, '') expected_events = [ - extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]), - extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]), + extract.ExtractEvent( + source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]), + extract.ExtractEvent( + source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]), ] target = extractcode.get_extraction_path(test_dir) diff --git a/tests/test_extractcode.py b/tests/test_extractcode.py index cf06d44..ad2118f 100644 --- a/tests/test_extractcode.py +++ b/tests/test_extractcode.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/tests/test_extractcode_api.py b/tests/test_extractcode_api.py index 0e6e073..a5f1c8b 100644 --- a/tests/test_extractcode_api.py +++ b/tests/test_extractcode_api.py @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -35,8 +35,10 @@ def test_extract_archive(self): cleaned_test_file = test_dir.replace(base, '') expected_event = [ - extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]), - extract.ExtractEvent(source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]), + extract.ExtractEvent( + source='doc.docx', target='doc.docx-extract', done=False, warnings=[], errors=[]), + extract.ExtractEvent( + source='doc.docx', target='doc.docx-extract', done=True, warnings=[], errors=[]), ] target = extractcode.get_extraction_path(test_dir) result = list(api.extract_archive(test_dir, target)) diff --git a/tests/test_extractcode_cli.py b/tests/test_extractcode_cli.py index aa9864f..0ee9da3 100644 --- a/tests/test_extractcode_cli.py +++ b/tests/test_extractcode_cli.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -38,11 +38,11 @@ def run_extract(options, expected_rc=None, cwd=None): assert os.path.exists(cmd_loc + ('.exe' if on_windows else '')) args = [cmd_loc] + options result = subprocess.run(args, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - cwd=cwd, - universal_newlines=True, - ) + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + cwd=cwd, + universal_newlines=True, + ) if expected_rc is not None and result.returncode != expected_rc: opts = ' '.join(options) @@ -103,13 +103,14 @@ def test_extractcode_command_works_with_relative_paths(): # dir where we run tests from, i.e. the git checkout dir To use relative # paths, we use our tmp dir at the root of the code tree from os.path import join - from commoncode import fileutils + from commoncode import fileutils import extractcode import tempfile import shutil try: - test_file = test_env.get_test_loc('cli/extract_relative_path/basic.zip') + test_file = test_env.get_test_loc( + 'cli/extract_relative_path/basic.zip') project_tmp = join(project_root, 'tmp') fileutils.create_dir(project_tmp) @@ -120,7 +121,8 @@ def test_extractcode_command_works_with_relative_paths(): shutil.copy(test_file, temp_rel) test_src_file = join(relative_dir, 'basic.zip') - test_tgt_dir = join(project_root, test_src_file) + extractcode.EXTRACT_SUFFIX + test_tgt_dir = join(project_root, test_src_file) + \ + extractcode.EXTRACT_SUFFIX result = run_extract([test_src_file], expected_rc=0, cwd=project_root) assert 'Extracting done' in result.stderr @@ -143,19 +145,21 @@ def test_extractcode_command_works_with_relative_paths_verbose(): # to the base dir where we run tests from, i.e. the git checkout dir # To use relative paths, we use our tmp dir at the root of the code tree from os.path import join - from commoncode import fileutils + from commoncode import fileutils import tempfile import shutil try: project_tmp = join(project_root, 'tmp') fileutils.create_dir(project_tmp) - test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace(project_root, '').strip('\\/') - test_file = test_env.get_test_loc('cli/extract_relative_path/basic.zip') + test_src_dir = tempfile.mkdtemp(dir=project_tmp).replace( + project_root, '').strip('\\/') + test_file = test_env.get_test_loc( + 'cli/extract_relative_path/basic.zip') shutil.copy(test_file, test_src_dir) test_src_file = join(test_src_dir, 'basic.zip') - result = run_extract(['--verbose', test_src_file] , expected_rc=0) + result = run_extract(['--verbose', test_src_file], expected_rc=0) # extract the path from the second line of the output # check that the path is relative and not absolute @@ -174,7 +178,7 @@ def test_extractcode_command_works_with_relative_paths_verbose(): def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): options = ['--help'] - result = run_extract(options , expected_rc=0) + result = run_extract(options, expected_rc=0) assert 'Usage: extractcode [OPTIONS]' in result.stdout # this was showing up on Windows @@ -185,20 +189,21 @@ def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): # this was showing up on Windows assert 'extractcode-script.py' not in result.stderr - result = run_extract(['-xyz'] , expected_rc=2) + result = run_extract(['-xyz'], expected_rc=2) # this was showing up on Windows assert 'extractcode-script.py' not in result.stderr def test_extractcode_command_can_extract_archive_with_unicode_names_verbose(): test_dir = test_env.get_test_loc('cli/unicodearch', copy=True) - result = run_extract(['--verbose', test_dir] , expected_rc=0) + result = run_extract(['--verbose', test_dir], expected_rc=0) assert 'Sanders' in result.stdout file_result = [ f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith('unicodepath.tgz')] - file_result = [''.join(f.partition('/unicodepath/')[1:]) for f in file_result] + file_result = [''.join(f.partition('/unicodepath/')[1:]) + for f in file_result] file_result = [f for f in file_result if f] expected = [ '/unicodepath/Ho_', @@ -210,12 +215,13 @@ def test_extractcode_command_can_extract_archive_with_unicode_names_verbose(): def test_extractcode_command_can_extract_archive_with_unicode_names(): test_dir = test_env.get_test_loc('cli/unicodearch', copy=True) - run_extract([test_dir] , expected_rc=0) + run_extract([test_dir], expected_rc=0) file_result = [ f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith('unicodepath.tgz')] - file_result = [''.join(f.partition('/unicodepath/')[1:]) for f in file_result] + file_result = [''.join(f.partition('/unicodepath/')[1:]) + for f in file_result] file_result = [f for f in file_result if f] expected = [ '/unicodepath/Ho_', @@ -227,12 +233,13 @@ def test_extractcode_command_can_extract_archive_with_unicode_names(): def test_extractcode_command_can_extract_shallow(): test_dir = test_env.get_test_loc('cli/extract_shallow', copy=True) - run_extract(['--shallow', test_dir] , expected_rc=0) + run_extract(['--shallow', test_dir], expected_rc=0) file_result = [ f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith('unicodepath.tgz')] - file_result = [''.join(f.partition('/top.zip-extract/')[1:]) for f in file_result] + file_result = [''.join(f.partition('/top.zip-extract/')[1:]) + for f in file_result] file_result = [f for f in file_result if f] # this checks that the zip in top.zip are not extracted expected = [ @@ -245,12 +252,13 @@ def test_extractcode_command_can_extract_shallow(): def test_extractcode_command_can_ignore(): test_dir = test_env.get_test_loc('cli/extract_ignore', copy=True) - run_extract(['--ignore', '*.tar', test_dir] , expected_rc=0) + run_extract(['--ignore', '*.tar', test_dir], expected_rc=0) file_result = [ f for f in map(as_posixpath, resource_iter(test_dir, with_dirs=False)) if not f.endswith('a.tar') or not f.endswith('b.tar')] - file_result = [''.join(f.partition('/a.zip-extract/')[1:]) for f in file_result] + file_result = [''.join(f.partition('/a.zip-extract/')[1:]) + for f in file_result] file_result = [f for f in file_result if f] expected = [ '/a.zip-extract/a.txt', @@ -263,7 +271,8 @@ def test_extractcode_command_can_ignore(): def test_extractcode_command_does_not_crash_with_replace_originals_and_corrupted_archives(): test_dir = test_env.get_test_loc('cli/replace-originals', copy=True) - result = run_extract(['--replace-originals', '--verbose', test_dir] , expected_rc=1) + result = run_extract( + ['--replace-originals', '--verbose', test_dir], expected_rc=1) assert not os.path.exists(os.path.join(test_dir, 'rake.1.gz-extract')) assert 'rake.1.gz' in result.stdout diff --git a/tests/test_libarchive2.py b/tests/test_libarchive2.py index 0ea6cb3..8dd5501 100644 --- a/tests/test_libarchive2.py +++ b/tests/test_libarchive2.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # diff --git a/tests/test_patch.py b/tests/test_patch.py index c3f4008..206f75d 100644 --- a/tests/test_patch.py +++ b/tests/test_patch.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -21,7 +21,8 @@ import patch as _pythonpatch except ImportError: import pytest - pytestmark = pytest.mark.skipif(True, reason="Run only if patch is installed.") + pytestmark = pytest.mark.skipif( + True, reason="Run only if patch is installed.") class TestIsPatch(FileBasedTesting): @@ -63,13 +64,15 @@ class TestPatchInfoFailing(FileBasedTesting): @expectedFailure def test_patch_info_patch_patches_misc_webkit_opensource_patches_sync_xhr_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/sync_xhr.patch') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/sync_xhr.patch') # fails with Exception Unable to parse patch file list(patch.patch_info(test_file)) @expectedFailure def test_patch_info_patch_patches_problematic_opensso_patch(self): - test_file = self.get_test_loc(u'patch/patches/problematic/OpenSSO.patch') + test_file = self.get_test_loc( + u'patch/patches/problematic/OpenSSO.patch') # fails with Exception Unable to parse patch file list(patch.patch_info(test_file)) @@ -79,975 +82,1360 @@ class TestPatchInfo(FileBasedTesting): def test_patch_info_patch_patches_dnsmasq_2_63_1_diff(self): test_file = self.get_test_loc(u'patch/patches/dnsmasq_2.63-1.diff') - expected_file = self.get_test_loc('patch/patches/dnsmasq_2.63-1.diff.expected') + expected_file = self.get_test_loc( + 'patch/patches/dnsmasq_2.63-1.diff.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_dropbear_2012_55_1_diff(self): test_file = self.get_test_loc(u'patch/patches/dropbear_2012.55-1.diff') - expected_file = self.get_test_loc('patch/patches/dropbear_2012.55-1.diff.expected') + expected_file = self.get_test_loc( + 'patch/patches/dropbear_2012.55-1.diff.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_electricfence_2_0_5_longjmp_patch(self): - test_file = self.get_test_loc(u'patch/patches/ElectricFence-2.0.5-longjmp.patch') - expected_file = self.get_test_loc('patch/patches/ElectricFence-2.0.5-longjmp.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/ElectricFence-2.0.5-longjmp.patch') + expected_file = self.get_test_loc( + 'patch/patches/ElectricFence-2.0.5-longjmp.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_electricfence_2_1_vaarg_patch(self): - test_file = self.get_test_loc(u'patch/patches/ElectricFence-2.1-vaarg.patch') - expected_file = self.get_test_loc('patch/patches/ElectricFence-2.1-vaarg.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/ElectricFence-2.1-vaarg.patch') + expected_file = self.get_test_loc( + 'patch/patches/ElectricFence-2.1-vaarg.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_electricfence_2_2_2_madvise_patch(self): - test_file = self.get_test_loc(u'patch/patches/ElectricFence-2.2.2-madvise.patch') - expected_file = self.get_test_loc('patch/patches/ElectricFence-2.2.2-madvise.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/ElectricFence-2.2.2-madvise.patch') + expected_file = self.get_test_loc( + 'patch/patches/ElectricFence-2.2.2-madvise.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_electricfence_2_2_2_pthread_patch(self): - test_file = self.get_test_loc(u'patch/patches/ElectricFence-2.2.2-pthread.patch') - expected_file = self.get_test_loc('patch/patches/ElectricFence-2.2.2-pthread.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/ElectricFence-2.2.2-pthread.patch') + expected_file = self.get_test_loc( + 'patch/patches/ElectricFence-2.2.2-pthread.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_libmediainfo_0_7_43_diff(self): - test_file = self.get_test_loc(u'patch/patches/libmediainfo-0.7.43.diff') - expected_file = self.get_test_loc('patch/patches/libmediainfo-0.7.43.diff.expected') + test_file = self.get_test_loc( + u'patch/patches/libmediainfo-0.7.43.diff') + expected_file = self.get_test_loc( + 'patch/patches/libmediainfo-0.7.43.diff.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_avahi_0_6_25_patches_configure_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/avahi-0.6.25/patches/configure.patch') - expected_file = self.get_test_loc('patch/patches/misc/avahi-0.6.25/patches/configure.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/avahi-0.6.25/patches/configure.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/avahi-0.6.25/patches/configure.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_avahi_0_6_25_patches_main_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/avahi-0.6.25/patches/main.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/avahi-0.6.25/patches/main.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/avahi-0.6.25/patches/main.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/avahi-0.6.25/patches/main.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_busybox_patches_fix_subarch_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/busybox/patches/fix-subarch.patch') - expected_file = self.get_test_loc('patch/patches/misc/busybox/patches/fix-subarch.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/busybox/patches/fix-subarch.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/busybox/patches/fix-subarch.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_busybox_patches_gtrick_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/busybox/patches/gtrick.patch') - expected_file = self.get_test_loc('patch/patches/misc/busybox/patches/gtrick.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/busybox/patches/gtrick.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/busybox/patches/gtrick.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_busybox_patches_workaround_old_uclibc_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/busybox/patches/workaround_old_uclibc.patch') - expected_file = self.get_test_loc('patch/patches/misc/busybox/patches/workaround_old_uclibc.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/busybox/patches/workaround_old_uclibc.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/busybox/patches/workaround_old_uclibc.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_curl_patches_ekioh_cookie_fix_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/curl/patches/ekioh_cookie_fix.patch') - expected_file = self.get_test_loc('patch/patches/misc/curl/patches/ekioh_cookie_fix.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/curl/patches/ekioh_cookie_fix.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/curl/patches/ekioh_cookie_fix.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_e2fsprogs_1_37_uuidlibs_blkidlibs_only_target_makefile_in_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/e2fsprogs-1.37/uuidlibs_blkidlibs_only_target_Makefile.in.patch') - expected_file = self.get_test_loc('patch/patches/misc/e2fsprogs-1.37/uuidlibs_blkidlibs_only_target_Makefile.in.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/e2fsprogs-1.37/uuidlibs_blkidlibs_only_target_Makefile.in.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/e2fsprogs-1.37/uuidlibs_blkidlibs_only_target_Makefile.in.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_ekioh_svg_opensource_patches_patch_ekioh_config_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/ekioh-svg/opensource/patches/patch_ekioh_config.patch') - expected_file = self.get_test_loc('patch/patches/misc/ekioh-svg/opensource/patches/patch_ekioh_config.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/ekioh-svg/opensource/patches/patch_ekioh_config.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/ekioh-svg/opensource/patches/patch_ekioh_config.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_accelerated_blit_webcore_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webcore.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/accelerated_blit_webcore.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webcore.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webcore.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_accelerated_blit_webkit_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webkit.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/accelerated_blit_webkit.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webkit.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/accelerated_blit_webkit.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_animated_gif_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/animated_gif.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/animated_gif.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/animated_gif.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/animated_gif.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_computed_style_for_transform_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/computed_style_for_transform.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/computed_style_for_transform.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/computed_style_for_transform.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/computed_style_for_transform.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_cookies_fixes_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/cookies_fixes.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/cookies_fixes.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/cookies_fixes.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/cookies_fixes.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_dlna_image_security_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/dlna_image_security.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/dlna_image_security.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/dlna_image_security.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/dlna_image_security.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_draw_pattern_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/draw_pattern.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/draw_pattern.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/draw_pattern.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/draw_pattern.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_enable_logs_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/enable_logs.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/enable_logs.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/enable_logs.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/enable_logs.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_enable_proxy_setup_log_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/enable_proxy_setup_log.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/enable_proxy_setup_log.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/enable_proxy_setup_log.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/enable_proxy_setup_log.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_file_secure_mode_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/file_secure_mode.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/file_secure_mode.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/file_secure_mode.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/file_secure_mode.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_http_secure_mode_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/http_secure_mode.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/http_secure_mode.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/http_secure_mode.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/http_secure_mode.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_javascript_screen_resolution_fix_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/javascript_screen_resolution_fix.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/javascript_screen_resolution_fix.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/javascript_screen_resolution_fix.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/javascript_screen_resolution_fix.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_keycode_webkit_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/keycode_webkit.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/keycode_webkit.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/keycode_webkit.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/keycode_webkit.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_local_file_access_whitelist_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/local_file_access_whitelist.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/local_file_access_whitelist.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/local_file_access_whitelist.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/local_file_access_whitelist.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_lower_case_css_attributes_for_transform_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/lower_case_css_attributes_for_transform.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/lower_case_css_attributes_for_transform.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/lower_case_css_attributes_for_transform.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/lower_case_css_attributes_for_transform.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_moving_empty_image_leaves_garbage_on_screen_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/moving_empty_image_leaves_garbage_on_screen.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/moving_empty_image_leaves_garbage_on_screen.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/moving_empty_image_leaves_garbage_on_screen.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/moving_empty_image_leaves_garbage_on_screen.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_open_in_new_window_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/open_in_new_window.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/open_in_new_window.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/open_in_new_window.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/open_in_new_window.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_plugin_thread_async_call_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/plugin_thread_async_call.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/plugin_thread_async_call.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/plugin_thread_async_call.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/plugin_thread_async_call.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_ram_cache_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/ram_cache.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/ram_cache.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/ram_cache.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/ram_cache.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_ram_cache_meta_expires_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/ram_cache_meta_expires.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/ram_cache_meta_expires.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/ram_cache_meta_expires.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/ram_cache_meta_expires.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_speedup_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/speedup.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/speedup.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/speedup.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/speedup.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_sync_xhr_https_access_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/sync_xhr_https_access.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/sync_xhr_https_access.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/sync_xhr_https_access.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/sync_xhr_https_access.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_useragent_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/useragent.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/useragent.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/useragent.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/useragent.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webcore_keyevent_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webcore_keyevent.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webcore_keyevent.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webcore_keyevent.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webcore_keyevent.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webcore_videoplane_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webcore_videoplane.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webkit_cssparser_parsetransitionshorthand_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webkit_CSSParser_parseTransitionShorthand.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webkit_CSSParser_parseTransitionShorthand.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webkit_CSSParser_parseTransitionShorthand.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webkit_CSSParser_parseTransitionShorthand.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webkit_database_support_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webkit_database_support.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webkit_database_support.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webkit_database_support.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webkit_database_support.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webkit_dlna_images_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webkit_dlna_images.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webkit_dlna_images.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webkit_dlna_images.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webkit_dlna_images.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webkit_finish_animations_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webkit_finish_animations.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webkit_finish_animations.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webkit_finish_animations.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webkit_finish_animations.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_patches_webkit_xmlhttprequest_cross_domain_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/patches/webkit_xmlhttprequest_cross_domain.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/patches/webkit_xmlhttprequest_cross_domain.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/patches/webkit_xmlhttprequest_cross_domain.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/patches/webkit_xmlhttprequest_cross_domain.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_moto_createobject_null_check_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/moto-createobject-null-check.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/moto-createobject-null-check.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/moto-createobject-null-check.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/moto-createobject-null-check.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_moto_dump_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/moto-dump.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/moto-dump.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/moto-dump.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/moto-dump.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_moto_getopensourcenotice_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/moto-getopensourcenotice.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/moto-getopensourcenotice.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/moto-getopensourcenotice.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/moto-getopensourcenotice.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_moto_jsvalue_equal_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/moto-jsvalue-equal.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/moto-jsvalue-equal.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/moto-jsvalue-equal.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/moto-jsvalue-equal.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_moto_timer_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/moto-timer.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/moto-timer.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/moto-timer.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/moto-timer.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_support_parallel_idl_gen_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/support_parallel_idl_gen.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/support_parallel_idl_gen.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/support_parallel_idl_gen.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/support_parallel_idl_gen.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_webcore_accept_click_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/webcore_accept_click.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/webcore_accept_click.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/webcore_accept_click.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/webcore_accept_click.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_webkit_opensource_prepatches_webcore_videoplane_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch') - expected_file = self.get_test_loc('patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/webkit/opensource/prepatches/webcore_videoplane.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_icu_patches_ekioh_config_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/icu/patches/ekioh-config.patch') - expected_file = self.get_test_loc('patch/patches/misc/icu/patches/ekioh-config.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/icu/patches/ekioh-config.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/icu/patches/ekioh-config.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_jfsutils_patches_largefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/jfsutils/patches/largefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/jfsutils/patches/largefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/jfsutils/patches/largefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/jfsutils/patches/largefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libasyncns_asyncns_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libasyncns/asyncns.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/libasyncns/asyncns.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libasyncns/asyncns.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libasyncns/asyncns.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libasyncns_configure_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libasyncns/configure.patch') - expected_file = self.get_test_loc('patch/patches/misc/libasyncns/configure.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libasyncns/configure.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libasyncns/configure.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libdaemon_0_13_patches_configure_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libdaemon-0.13/patches/configure.patch') - expected_file = self.get_test_loc('patch/patches/misc/libdaemon-0.13/patches/configure.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libdaemon-0.13/patches/configure.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libdaemon-0.13/patches/configure.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libiconv_patches_cp932_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libiconv/patches/cp932.patch') - expected_file = self.get_test_loc('patch/patches/misc/libiconv/patches/cp932.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libiconv/patches/cp932.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libiconv/patches/cp932.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libiconv_patches_make_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libiconv/patches/make.patch') - expected_file = self.get_test_loc('patch/patches/misc/libiconv/patches/make.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libiconv/patches/make.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libiconv/patches/make.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libjpeg_v6b_patches_config_sub_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libjpeg-v6b/patches/config.sub.patch') - expected_file = self.get_test_loc('patch/patches/misc/libjpeg-v6b/patches/config.sub.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libjpeg-v6b/patches/config.sub.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libjpeg-v6b/patches/config.sub.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libjpeg_v6b_patches_configure_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libjpeg-v6b/patches/configure.patch') - expected_file = self.get_test_loc('patch/patches/misc/libjpeg-v6b/patches/configure.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libjpeg-v6b/patches/configure.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libjpeg-v6b/patches/configure.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libjpeg_v6b_patches_makefile_cfg_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libjpeg-v6b/patches/makefile.cfg.patch') - expected_file = self.get_test_loc('patch/patches/misc/libjpeg-v6b/patches/makefile.cfg.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libjpeg-v6b/patches/makefile.cfg.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libjpeg-v6b/patches/makefile.cfg.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libpng_1_2_8_makefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libpng-1.2.8/makefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/libpng-1.2.8/makefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libpng-1.2.8/makefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libpng-1.2.8/makefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libpng_1_2_8_pngconf_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libpng-1.2.8/pngconf.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/libpng-1.2.8/pngconf.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libpng-1.2.8/pngconf.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libpng-1.2.8/pngconf.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libpng_1_2_8_pngrutil_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libpng-1.2.8/pngrutil.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/libpng-1.2.8/pngrutil.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libpng-1.2.8/pngrutil.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libpng-1.2.8/pngrutil.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_libxml2_patches_iconv_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/libxml2/patches/iconv.patch') - expected_file = self.get_test_loc('patch/patches/misc/libxml2/patches/iconv.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/libxml2/patches/iconv.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/libxml2/patches/iconv.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_0001_stmmac_updated_the_driver_and_added_several_fixes_a_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/0001-stmmac-updated-the-driver-and-added-several-fixes-a.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/0001-stmmac-updated-the-driver-and-added-several-fixes-a.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/0001-stmmac-updated-the-driver-and-added-several-fixes-a.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/0001-stmmac-updated-the-driver-and-added-several-fixes-a.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_addrspace_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/addrspace.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/addrspace.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/addrspace.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/addrspace.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_arch_sh_kernel_cpu_init_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/arch_sh_kernel_cpu_init.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/arch_sh_kernel_cpu_init.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/arch_sh_kernel_cpu_init.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/arch_sh_kernel_cpu_init.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_arch_sh_makefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/arch_sh_Makefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/arch_sh_Makefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/arch_sh_Makefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/arch_sh_Makefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_arch_sh_mm_init_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/arch_sh_mm_init.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/arch_sh_mm_init.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/arch_sh_mm_init.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/arch_sh_mm_init.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_bigphysarea_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/bigphysarea.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/bigphysarea.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/bigphysarea.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/bigphysarea.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_bugs_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/bugs.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/bugs.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/bugs.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/bugs.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_cache_sh4_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/cache-sh4.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/cache-sh4.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/cache-sh4.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/cache-sh4.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_cfi_cmdset_0001_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/cfi_cmdset_0001.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/cfi_cmdset_0001.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/cfi_cmdset_0001.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/cfi_cmdset_0001.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_cfi_util_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/cfi_util.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/cfi_util.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/cfi_util.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/cfi_util.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_char_build_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/char_build.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/char_build.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/char_build.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/char_build.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_cmdlinepart_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/cmdlinepart.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/cmdlinepart.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/cmdlinepart.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/cmdlinepart.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_console_printk_loglevel_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/console_printk_loglevel.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/console_printk_loglevel.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/console_printk_loglevel.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/console_printk_loglevel.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_delayed_i2c_read_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/delayed_i2c_read.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/delayed_i2c_read.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/delayed_i2c_read.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/delayed_i2c_read.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_devinet_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/devinet.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/devinet.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/devinet.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/devinet.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_disable_carrier_sense_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/disable_carrier_sense.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/disable_carrier_sense.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/disable_carrier_sense.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/disable_carrier_sense.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_disable_unaligned_printks_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/disable_unaligned_printks.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/disable_unaligned_printks.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/disable_unaligned_printks.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/disable_unaligned_printks.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_dma_api_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/dma-api.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/dma-api.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/dma-api.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/dma-api.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_do_mounts_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/do_mounts.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/do_mounts.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/do_mounts.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/do_mounts.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_drivers_net_makefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/drivers_net_Makefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/drivers_net_Makefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/drivers_net_Makefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/drivers_net_Makefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_fan_ctrl_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/fan_ctrl.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/fan_ctrl.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/fan_ctrl.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/fan_ctrl.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_hcd_stm_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/hcd_stm.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/hcd_stm.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/hcd_stm.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/hcd_stm.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_head_s_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/head.S.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/head.S.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/head.S.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/head.S.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_i2c_stm_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_i2c_stm_c_patch2(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch2') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch2.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch2') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/i2c-stm.c.patch2.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_i2c_nostop_for_bitbanging_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/i2c_nostop_for_bitbanging.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/i2c_nostop_for_bitbanging.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/i2c_nostop_for_bitbanging.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/i2c_nostop_for_bitbanging.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_i2c_rate_normal_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/i2c_rate_normal.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/i2c_rate_normal.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/i2c_rate_normal.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/i2c_rate_normal.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_i2c_revert_to_117_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/i2c_revert_to_117.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/i2c_revert_to_117.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/i2c_revert_to_117.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/i2c_revert_to_117.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_if_ppp_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/if_ppp.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/if_ppp.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/if_ppp.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/if_ppp.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_inittmpfs_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/inittmpfs.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/inittmpfs.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/inittmpfs.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/inittmpfs.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_init_kconfig_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/init_Kconfig.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/init_Kconfig.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/init_Kconfig.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/init_Kconfig.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_init_main_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/init_main.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/init_main.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/init_main.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/init_main.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_ioremap_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/ioremap.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/ioremap.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/ioremap.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/ioremap.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_ipconfig_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/ipconfig.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/ipconfig.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/ipconfig.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/ipconfig.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_kernel_extable_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/kernel_extable.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/kernel_extable.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/kernel_extable.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/kernel_extable.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_kernel_resource_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/kernel_resource.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/kernel_resource.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/kernel_resource.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/kernel_resource.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_kexec_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/kexec.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/kexec.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/kexec.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/kexec.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_ksymhash_elflib_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/ksymhash_elflib.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/ksymhash_elflib.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/ksymhash_elflib.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/ksymhash_elflib.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_libata_sense_data_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/libata_sense_data.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/libata_sense_data.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/libata_sense_data.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/libata_sense_data.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_localversion_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/localversion.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/localversion.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/localversion.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/localversion.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_mach_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/mach.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/mach.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/mach.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/mach.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_marvell_88e3015_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/marvell_88e3015.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/marvell_88e3015.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/marvell_88e3015.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/marvell_88e3015.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_mb442_setup_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/mb442_setup.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/mb442_setup.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/mb442_setup.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/mb442_setup.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_mmu_context_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/mmu_context.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/mmu_context.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/mmu_context.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/mmu_context.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_motorola_make_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/motorola_make.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/motorola_make.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/motorola_make.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/motorola_make.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_motorola_rootdisk_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/motorola_rootdisk.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_namespace_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/namespace.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/namespace.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/namespace.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/namespace.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_nand_flash_based_bbt_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/nand_flash_based_bbt.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/nand_flash_based_bbt.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/nand_flash_based_bbt.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/nand_flash_based_bbt.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_nand_old_oob_layout_for_yaffs2_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/nand_old_oob_layout_for_yaffs2.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/nand_old_oob_layout_for_yaffs2.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/nand_old_oob_layout_for_yaffs2.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/nand_old_oob_layout_for_yaffs2.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_netconsole_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/netconsole.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/netconsole.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/netconsole.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/netconsole.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_netconsole_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/netconsole.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/netconsole.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/netconsole.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/netconsole.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_nfsroot_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/nfsroot.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/nfsroot.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/nfsroot.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/nfsroot.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_page_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/page.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/page.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/page.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/page.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_page_alloc_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/page_alloc.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/page_alloc.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/page_alloc.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/page_alloc.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_pgtable_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/pgtable.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/pgtable.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/pgtable.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/pgtable.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_phy_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/phy.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/phy.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/phy.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/phy.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_phy_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/phy.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/phy.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/phy.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/phy.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_phy_device_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/phy_device.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/phy_device.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/phy_device.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/phy_device.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_pid_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/pid.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/pid.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/pid.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/pid.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_pio_irq_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/pio-irq.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/pio-irq.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/pio-irq.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/pio-irq.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_pmb_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/pmb.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/pmb.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/pmb.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/pmb.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_process_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/process.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/process.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/process.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/process.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_sample_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/sample.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/sample.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/sample.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/sample.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_sched_cfs_v2_6_23_12_v24_1_mod_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/sched-cfs-v2.6.23.12-v24.1.mod.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_setup_stb7100_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/setup-stb7100.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/setup-stb7100.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/setup-stb7100.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/setup-stb7100.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_setup_stx7105_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/setup-stx7105.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/setup-stx7105.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/setup-stx7105.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/setup-stx7105.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_setup_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/setup.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/setup.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/setup.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/setup.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_sh_kernel_setup_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/sh_kernel_setup.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/sh_kernel_setup.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/sh_kernel_setup.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/sh_kernel_setup.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_sh_ksyms_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/sh_ksyms.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/sh_ksyms.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/sh_ksyms.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/sh_ksyms.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_smsc_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/smsc.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/smsc.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/smsc.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/smsc.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_smsc_makefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/smsc_makefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/smsc_makefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/smsc_makefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/smsc_makefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_soc_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/soc.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/soc.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/soc.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/soc.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_squashfs3_3_revert_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/squashfs3.3_revert.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_squashfs3_3_revert1_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert1.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_squashfs3_3_revert2_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert2.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_squashfs3_3_revert3_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/squashfs3.3_revert3.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_squashfs3_4_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/squashfs3.4.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/squashfs3.4.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/squashfs3.4.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_stasc_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/stasc.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/stasc.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/stasc.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/stasc.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_stmmac_main_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/stmmac_main.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/stmmac_main.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/stmmac_main.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/stmmac_main.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_suppress_igmp_report_listening_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/suppress_igmp_report_listening.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/suppress_igmp_report_listening.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/suppress_igmp_report_listening.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/suppress_igmp_report_listening.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_time_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/time.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/time.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/time.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/time.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_unionfs_2_5_1_for_2_6_23_17_diff(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/unionfs-2.5.1_for_2.6.23.17.diff.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_unionfs_remove_debug_printouts_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/unionfs_remove_debug_printouts.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/unionfs_remove_debug_printouts.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/unionfs_remove_debug_printouts.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/unionfs_remove_debug_printouts.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vip19x0_vidmem_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vip19x0_vidmem.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vip19x0_vidmem.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vip19x0_vidmem.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vip19x0_vidmem.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vip19x3_board_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vip19x3_board.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vip19x3_board.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vip19x3_board.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vip19x3_board.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vip19xx_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vip19xx.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vip19xx.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vip19xx.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vip19xx.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vip19xx_nand_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vip19xx_nand.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vip19xx_nor_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vip19xx_nor.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_vt_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/vt.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/vt.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/vt.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/vt.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_yaffs2_2008_07_15_for_2_6_23_17_yaffs_guts_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17-yaffs_guts.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17-yaffs_guts.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17-yaffs_guts.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17-yaffs_guts.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_linux_st710x_patches_yaffs2_2008_07_15_for_2_6_23_17_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch') - expected_file = self.get_test_loc('patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/linux-st710x/patches/yaffs2-2008.07.15_for_2.6.23.17.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_npapi_patches_npapi_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/npapi/patches/npapi.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/npapi/patches/npapi.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/npapi/patches/npapi.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/npapi/patches/npapi.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_openssl_0_9_8_patches_configure_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/openssl-0.9.8/patches/Configure.patch') - expected_file = self.get_test_loc('patch/patches/misc/openssl-0.9.8/patches/Configure.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/openssl-0.9.8/patches/Configure.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/openssl-0.9.8/patches/Configure.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_sqlite_patches_permissions_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/sqlite/patches/permissions.patch') - expected_file = self.get_test_loc('patch/patches/misc/sqlite/patches/permissions.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/sqlite/patches/permissions.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/sqlite/patches/permissions.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_arpping_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/arpping.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/arpping.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/arpping.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/arpping.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_clientpacket_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/clientpacket.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_clientpacket_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/clientpacket.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/clientpacket.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_debug_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/debug.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/debug.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/debug.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/debug.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_dhcpc_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/dhcpc.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_dhcpc_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/dhcpc.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/dhcpc.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_dhcpd_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/dhcpd.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/dhcpd.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/dhcpd.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/dhcpd.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_makefile_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/Makefile.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/Makefile.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/Makefile.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/Makefile.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_options_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/options.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/options.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/options.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/options.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_options_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/options.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/options.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/options.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/options.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_packet_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/packet.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/packet.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/packet.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/packet.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_packet_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/packet.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/packet.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/packet.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/packet.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_route_patch1(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/route.patch1') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/route.patch1.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/route.patch1') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/route.patch1.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_script_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/script.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/script.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/script.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/script.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_udhcp_0_9_8_patch_t1t2_patch1(self): - test_file = self.get_test_loc(u'patch/patches/misc/udhcp-0.9.8/patch/t1t2.patch1') - expected_file = self.get_test_loc('patch/patches/misc/udhcp-0.9.8/patch/t1t2.patch1.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/udhcp-0.9.8/patch/t1t2.patch1') + expected_file = self.get_test_loc( + 'patch/patches/misc/udhcp-0.9.8/patch/t1t2.patch1.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_build_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/BUILD.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/BUILD.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/BUILD.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/BUILD.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_cross_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/cross.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/cross.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/cross.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/cross.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_uclibc_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/uclibc.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/uclibc.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/uclibc.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/uclibc.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_vqec_ifclient_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/vqec_ifclient.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/vqec_ifclient.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/vqec_ifclient.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/vqec_ifclient.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_vqec_wv_c_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/vqec_wv.c.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/vqec_wv.c.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/vqec_wv.c.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/vqec_wv.c.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_misc_vqec_patch_vqec_wv_h_patch(self): - test_file = self.get_test_loc(u'patch/patches/misc/vqec/patch/vqec_wv.h.patch') - expected_file = self.get_test_loc('patch/patches/misc/vqec/patch/vqec_wv.h.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/misc/vqec/patch/vqec_wv.h.patch') + expected_file = self.get_test_loc( + 'patch/patches/misc/vqec/patch/vqec_wv.h.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_postgrey_1_30_group_patch(self): - test_file = self.get_test_loc(u'patch/patches/postgrey-1.30-group.patch') - expected_file = self.get_test_loc('patch/patches/postgrey-1.30-group.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/postgrey-1.30-group.patch') + expected_file = self.get_test_loc( + 'patch/patches/postgrey-1.30-group.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_drupal_upload_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/drupal_upload.patch') - expected_file = self.get_test_loc('patch/patches/windows/drupal_upload.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/drupal_upload.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/drupal_upload.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_ether_patch_1_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/ether_patch_1.patch') - expected_file = self.get_test_loc('patch/patches/windows/ether_patch_1.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/ether_patch_1.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/ether_patch_1.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_js_delete_patch(self): test_file = self.get_test_loc(u'patch/patches/windows/js_delete.patch') - expected_file = self.get_test_loc('patch/patches/windows/js_delete.patch.expected') + expected_file = self.get_test_loc( + 'patch/patches/windows/js_delete.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_plugin_explorer_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/plugin explorer.patch') - expected_file = self.get_test_loc('patch/patches/windows/plugin explorer.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/plugin explorer.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/plugin explorer.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_resolveentity32_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/resolveentity32.patch') - expected_file = self.get_test_loc('patch/patches/windows/resolveentity32.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/resolveentity32.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/resolveentity32.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_sift_patch(self): test_file = self.get_test_loc(u'patch/patches/windows/sift.patch') - expected_file = self.get_test_loc('patch/patches/windows/sift.patch.expected') + expected_file = self.get_test_loc( + 'patch/patches/windows/sift.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_thumbnail_support_0_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/thumbnail_support_0.patch') - expected_file = self.get_test_loc('patch/patches/windows/thumbnail_support_0.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/thumbnail_support_0.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/thumbnail_support_0.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_thumbnail_support_0_patch_1(self): - test_file = self.get_test_loc(u'patch/patches/windows/thumbnail_support_0.patch.1') - expected_file = self.get_test_loc('patch/patches/windows/thumbnail_support_0.patch.1.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/thumbnail_support_0.patch.1') + expected_file = self.get_test_loc( + 'patch/patches/windows/thumbnail_support_0.patch.1.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_webform_3_0_conditional_constructor_0_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/webform-3.0-conditional_constructor_0.patch') - expected_file = self.get_test_loc('patch/patches/windows/webform-3.0-conditional_constructor_0.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/webform-3.0-conditional_constructor_0.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/webform-3.0-conditional_constructor_0.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_windows_xml_rpc_addspace_patch(self): - test_file = self.get_test_loc(u'patch/patches/windows/xml_rpc_addSpace.patch') - expected_file = self.get_test_loc('patch/patches/windows/xml_rpc_addSpace.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/windows/xml_rpc_addSpace.patch') + expected_file = self.get_test_loc( + 'patch/patches/windows/xml_rpc_addSpace.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_xvidcap_1_1_6_docdir_patch(self): - test_file = self.get_test_loc(u'patch/patches/xvidcap-1.1.6-docdir.patch') - expected_file = self.get_test_loc('patch/patches/xvidcap-1.1.6-docdir.patch.expected') + test_file = self.get_test_loc( + u'patch/patches/xvidcap-1.1.6-docdir.patch') + expected_file = self.get_test_loc( + 'patch/patches/xvidcap-1.1.6-docdir.patch.expected') check_patch(test_file, expected_file) def test_patch_info_patch_patches_xvidcap_xorg_patch(self): test_file = self.get_test_loc(u'patch/patches/xvidcap-xorg.patch') - expected_file = self.get_test_loc('patch/patches/xvidcap-xorg.patch.expected') + expected_file = self.get_test_loc( + 'patch/patches/xvidcap-xorg.patch.expected') check_patch(test_file, expected_file) diff --git a/tests/test_sevenzip.py b/tests/test_sevenzip.py index 4a7637e..5ef942d 100644 --- a/tests/test_sevenzip.py +++ b/tests/test_sevenzip.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -53,7 +53,7 @@ def clean_dates(self, results): res['date'] = dt.partition(' ')[0] def test_get_7z_errors_password_protected(self): - test = ''' + test = ''' 7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30 Processing archive: c:\\w421\\scripts\\testfiles\\archive\\zip\\zip_password_nexb.zip @@ -62,12 +62,12 @@ def test_get_7z_errors_password_protected(self): Sub items Errors: 1 ''' - result = sevenzip.get_7z_errors(test, test) - expected = 'Password protected archive, unable to extract' - assert expected == result + result = sevenzip.get_7z_errors(test, test) + expected = 'Password protected archive, unable to extract' + assert expected == result def test_list_extracted_7z_files_empty(self): - assert [] == sevenzip.list_extracted_7z_files('') + assert [] == sevenzip.list_extracted_7z_files('') def test_list_extracted_7z_files_2(self): test = ''' @@ -126,7 +126,8 @@ def test_extract_of_tar_with_aboslute_path(self): sevenzip.extract(test_loc, target_dir, file_by_file=False) expected_loc = test_loc + '-extract-expected.json' results = self.collect_extracted_path(target_dir) - self.check_results_with_expected_json(results, expected_loc, regen=False) + self.check_results_with_expected_json( + results, expected_loc, regen=False) class TestSevenZipListEntries(TestSevenZip): @@ -139,7 +140,8 @@ def test_list_entries_of_special_tar(self): entries = [e.to_dict(full=True) for e in entries] errors = errors or [] results = entries + errors - self.check_results_with_expected_json(results, expected_loc, regen=False) + self.check_results_with_expected_json( + results, expected_loc, regen=False) @pytest.mark.skipif(not on_windows, reason='Windows file-by-file extracton is not working well') def test_list_entries_of_special_tar_win(self): @@ -149,7 +151,8 @@ def test_list_entries_of_special_tar_win(self): entries = [e.to_dict(full=True) for e in entries] errors = errors or [] results = entries + errors - self.check_results_with_expected_json(results, expected_loc, clean_dates=True, regen=False) + self.check_results_with_expected_json( + results, expected_loc, clean_dates=True, regen=False) @pytest.mark.skipif(on_windows, reason='Windows file-by-file extracton is not working well') def test_list_entries_with_weird_names_7z(self): @@ -159,7 +162,8 @@ def test_list_entries_with_weird_names_7z(self): entries = [e.to_dict(full=True) for e in entries] errors = errors or [] results = entries + errors - self.check_results_with_expected_json(results, expected_loc, regen=False) + self.check_results_with_expected_json( + results, expected_loc, regen=False) @pytest.mark.skipif(not on_windows, reason='Windows file-by-file extracton is not working well') def test_list_entries_with_weird_names_7z_win(self): @@ -169,83 +173,107 @@ def test_list_entries_with_weird_names_7z_win(self): entries = [e.to_dict(full=True) for e in entries] errors = errors or [] results = entries + errors - self.check_results_with_expected_json(results, expected_loc, clean_dates=True, regen=False) + self.check_results_with_expected_json( + results, expected_loc, clean_dates=True, regen=False) class TestSevenParseListing(TestSevenZip): def check_parse_7z_listing(self, test_loc, regen=False): test_loc = self.get_test_loc(test_loc) - results = [e.to_dict(full=True) for e in sevenzip.parse_7z_listing(location=test_loc)] + results = [e.to_dict(full=True) + for e in sevenzip.parse_7z_listing(location=test_loc)] expected_loc = test_loc + '-expected.json' self.check_results_with_expected_json( results=results, expected_loc=expected_loc, regen=regen) def test_parse_7z_listing_cpio_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/cpio_relative.cpio.linux', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/cpio_relative.cpio.linux', regen=False) def test_parse_7z_listing_cpio_from_win(self): - self.check_parse_7z_listing('sevenzip/listings/cpio_relative.cpio.win', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/cpio_relative.cpio.win', regen=False) def test_parse_7z_listing_7z_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.7z_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.7z_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_7z_from_win(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.ar_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.ar_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_cpio_weird_names_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.cpio_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.cpio_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_iso_weird_names_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.iso_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.iso_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_rar_weird_names_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.rar_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.rar_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_tar_weird_names_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.tar_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.tar_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_zip_weird_names_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names.zip_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names.zip_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_z_from_mac(self): - self.check_parse_7z_listing('sevenzip/listings/single_file.z.mac', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/single_file.z.mac', regen=False) def test_parse_7z_listing_tarz_from_mac(self): - self.check_parse_7z_listing('sevenzip/listings/single_file.tarz.mac', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/single_file.tarz.mac', regen=False) def test_parse_7z_listing_shar_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/demo-spring-boot.sh.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/demo-spring-boot.sh.listing', regen=False) def test_parse_7z_listing_svgz_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/insert-emptyframe.svgz.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/insert-emptyframe.svgz.listing', regen=False) def test_parse_7z_listing_rpm_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.rpm.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/libsqueeze0.2_0-0.2.3-8mdv2010.0.i586.rpm.listing', regen=False) def test_parse_7z_listing_tbz_broken_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/tarred_bzipped_broken.tar.bz2.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/tarred_bzipped_broken.tar.bz2.listing', regen=False) def test_parse_7z_listing_tbz_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/tarred_bzipped.tar.bz2.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/tarred_bzipped.tar.bz2.listing', regen=False) def test_parse_7z_listing_txz_from_linux(self): - self.check_parse_7z_listing('sevenzip/listings/texlive-core-patches-20.tar.xz.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/texlive-core-patches-20.tar.xz.listing', regen=False) def test_parse_7z_listing_deb_linux(self): - self.check_parse_7z_listing('sevenzip/listings/adduser_3.113+nmu3ubuntu3_all.deb-linux.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/adduser_3.113+nmu3ubuntu3_all.deb-linux.listing', regen=False) def test_parse_7z_listing_special_tar_linux(self): - self.check_parse_7z_listing('sevenzip/listings/special.tar-linux.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/special.tar-linux.listing', regen=False) def test_parse_7z_listing_cbr_linux(self): - self.check_parse_7z_listing('sevenzip/listings/t.cbr-linux.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/t.cbr-linux.listing', regen=False) def test_parse_7z_listing_weird_names_7zip_linux(self): - self.check_parse_7z_listing('sevenzip/listings/weird_names-mini.7z_7zip_linux_listing.data', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/weird_names-mini.7z_7zip_linux_listing.data', regen=False) def test_parse_7z_listing_xar_linux(self): - self.check_parse_7z_listing('sevenzip/listings/xar-1.4.xar-linux.listing', regen=False) + self.check_parse_7z_listing( + 'sevenzip/listings/xar-1.4.xar-linux.listing', regen=False) class TestSevenZipFileByFile(TestSevenZip): @@ -263,17 +291,21 @@ def check_extract_file_by_file(self, test_file, regen=False): # this fails on some Windows 10 installs and not some others # based on symlinks creation permissions expected_err_loc = test_loc + '-extract-errors-expected' + suffix + '.json' - self.check_results_with_expected_json(e.args[0], expected_err_loc, regen=regen) + self.check_results_with_expected_json( + e.args[0], expected_err_loc, regen=regen) expected_loc = test_loc + '-extract-expected' + suffix + '.json' results = self.collect_extracted_path(target_dir) - self.check_results_with_expected_json(results, expected_loc, regen=regen) + self.check_results_with_expected_json( + results, expected_loc, regen=regen) def test_extract_file_by_file_of_tar_with_absolute_path(self): - self.check_extract_file_by_file('sevenzip/absolute_path.tar', regen=False) + self.check_extract_file_by_file( + 'sevenzip/absolute_path.tar', regen=False) def test_extract_file_by_file_of_nested_zip(self): - self.check_extract_file_by_file('sevenzip/relative_nested.zip', regen=False) + self.check_extract_file_by_file( + 'sevenzip/relative_nested.zip', regen=False) def test_extract_file_by_file_of_special_tar(self): self.check_extract_file_by_file('sevenzip/special.tar', regen=False) @@ -282,14 +314,17 @@ def test_extract_file_by_file_with_weird_names_7z(self): self.check_extract_file_by_file('sevenzip/weird_names.7z', regen=False) def test_extract_file_by_file_weird_names_zip(self): - self.check_extract_file_by_file('sevenzip/weird_names.zip', regen=False) + self.check_extract_file_by_file( + 'sevenzip/weird_names.zip', regen=False) @pytest.mark.xfail(on_windows, reason='Fails on Windows becasue it has file names that cannot be extracted there') def test_extract_file_by_file_weird_names_ar(self): self.check_extract_file_by_file('sevenzip/weird_names.ar', regen=False) def test_extract_file_by_file_weird_names_cpio(self): - self.check_extract_file_by_file('sevenzip/weird_names.cpio', regen=False) + self.check_extract_file_by_file( + 'sevenzip/weird_names.cpio', regen=False) def test_extract_file_by_file_weird_names_tar(self): - self.check_extract_file_by_file('sevenzip/weird_names.tar', regen=False) + self.check_extract_file_by_file( + 'sevenzip/weird_names.tar', regen=False) diff --git a/tests/test_vmimage.py b/tests/test_vmimage.py index 6653cdd..9df38db 100644 --- a/tests/test_vmimage.py +++ b/tests/test_vmimage.py @@ -3,7 +3,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/extractcode for support or download. +# See https://github.com/aboutcode-org/extractcode for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -34,14 +34,17 @@ def test_can_extract_qcow2_vm_image_as_tarball(self): test_file = self.extract_test_tar('vmimage/foobar.qcow2.tar.gz') test_file = str(Path(test_file) / 'foobar.qcow2') target_dir = self.get_temp_dir('vmimage') - vmimage.extract(location=test_file, target_dir=target_dir, as_tarballs=True) + vmimage.extract(location=test_file, + target_dir=target_dir, as_tarballs=True) expected = ['foobar.qcow2.tar.gz'] check_files(target_dir, expected) def test_can_extract_qcow2_vm_image_not_as_tarball(self): - test_file = self.extract_test_tar('vmimage/bios-tables-test.x86_64.iso.qcow2.tar.gz') + test_file = self.extract_test_tar( + 'vmimage/bios-tables-test.x86_64.iso.qcow2.tar.gz') test_file = str(Path(test_file) / 'bios-tables-test.x86_64.iso.qcow2') target_dir = self.get_temp_dir('vmimage') - vmimage.extract(location=test_file, target_dir=target_dir, as_tarballs=False) + vmimage.extract(location=test_file, + target_dir=target_dir, as_tarballs=False) expected = ['bios_tab.fat', 'boot.cat'] check_files(target_dir, expected)