diff --git a/eris/tools.py b/eris/tools.py index 41beeda..19242e8 100644 --- a/eris/tools.py +++ b/eris/tools.py @@ -114,7 +114,7 @@ def _run_command(command, success_status=None, error_status=None, error_status = Status.problem if error_status is None else error_status stdout, stderr, returncode = _do_command(command, timeout=timeout) result_status = success_status if returncode == 0 else error_status - return result_status, fill3.Text(stdout + stderr) + return result_status, (stdout + stderr) def deps(**kwargs): @@ -150,8 +150,9 @@ def _syntax_highlight(text, lexer, style): "", [termstr.TermStr(text, _char_style_for_token_type( token_type, default_bg_color, default_style)) for token_type, text in pygments.lex(text, lexer)]) - return fill3.Text(text, pad_char=termstr.TermStr(" ").bg_color( + text_widget = fill3.Text(text, pad_char=termstr.TermStr(" ").bg_color( default_bg_color)) + return fill3.join("\n", text_widget.text) def _syntax_highlight_using_path(text, path): @@ -230,7 +231,7 @@ def metadata(path): name = termstr.TermStr(name + ":").fg_color( termstr.Color.blue).ljust(16) text.append(name + fill3.join("", value) + "\n") - return (Status.normal, fill3.Text(fill3.join("", text))) + return (Status.normal, fill3.join("", text)) @deps(deps={"pip/pygments"}, url="python3-pygments") @@ -239,13 +240,13 @@ def contents(path): try: text = file_.read() except UnicodeDecodeError: - return Status.not_applicable, fill3.Text("Not unicode") + return Status.not_applicable, "Not unicode" text = _fix_input(text) try: - text_widget = _syntax_highlight_using_path(text, path) + text = _syntax_highlight_using_path(text, path) except pygments.util.ClassNotFound: - text_widget = fill3.Text(text) - return Status.normal, text_widget + pass + return Status.normal, text @deps(url="https://en.wikipedia.org/wiki/Python_syntax_and_semantics") @@ -258,7 +259,7 @@ def python_syntax(path): is_correct = False else: is_correct = True - return (Status.ok if is_correct else Status.problem), fill3.Text("") + return (Status.ok if is_correct else Status.problem), "" def _has_shebang_line(path): @@ -278,9 +279,9 @@ def python_unittests(path): else [PYTHON_EXECUTABLE, path]) stdout, stderr, returncode = _do_command(command, timeout=TIMEOUT) status = Status.ok if returncode == 0 else Status.problem - return status, fill3.Text(stdout + "\n" + stderr) + return status, (stdout + "\n" + stderr) else: - return Status.not_applicable, fill3.Text("No tests.") + return Status.not_applicable, "No tests." @deps(url="https://docs.python.org/3/library/pydoc.html") @@ -291,7 +292,7 @@ def pydoc(path): if not stdout.startswith("Help on module"): status = Status.not_applicable stdout = stdout.replace(os.getcwd() + "/", "") - return status, fill3.Text(_fix_input(stdout)) + return status, _fix_input(stdout) @deps(deps={"pip/mypy"}, url="http://mypy-lang.org/", executables={"mypy"}) @@ -300,7 +301,7 @@ def mypy(path): [PYTHON_EXECUTABLE, "-m", "mypy", "--ignore-missing-imports", path], timeout=TIMEOUT) status = Status.ok if returncode == 0 else Status.problem - return status, fill3.Text(stdout) + return status, stdout def _colorize_coverage_report(text): @@ -329,10 +330,10 @@ def python_coverage(path): flat_path = path.replace("/", "_") with open(os.path.join(temp_dir, flat_path + ",cover"), "r") as f: stdout = f.read() - return Status.normal, fill3.Text(_colorize_coverage_report(stdout)) + return Status.normal, _colorize_coverage_report(stdout) else: - return Status.not_applicable, fill3.Text( - "No corresponding test file: " + os.path.normpath(test_path)) + return Status.not_applicable, ("No corresponding test file: " + + os.path.normpath(test_path)) @deps(url="https://github.com/ahamilton/eris/blob/master/gut.py") @@ -363,7 +364,7 @@ def python_mccabe(path): max_score = max(_get_mccabe_line_score(line) for line in stdout.splitlines()) status = Status.problem if max_score > 10 else Status.ok - return status, fill3.Text(_colorize_mccabe(stdout)) + return status, _colorize_mccabe(stdout) # FIX: Reenable when pydisasm is not causing problems @@ -381,15 +382,15 @@ def bandit(path): timeout=TIMEOUT) status = Status.ok if returncode == 0 else Status.problem text_without_timestamp = "".join(stdout.splitlines(keepends=True)[2:]) - return status, fill3.Text(text_without_timestamp) + return status, text_without_timestamp @deps(deps={"perl-doc"}, url="http://perldoc.perl.org/", executables={"perldoc"}) def perldoc(path): stdout, stderr, returncode = _do_command(["perldoc", "-t", path]) - return ((Status.normal, fill3.Text(stdout)) if returncode == 0 - else (Status.not_applicable, fill3.Text(stderr))) + return ((Status.normal, stdout) if returncode == 0 + else (Status.not_applicable, stderr)) @deps(deps={"perltidy"}, url="http://perltidy.sourceforge.net/", @@ -407,8 +408,7 @@ def git_blame(path): "--color-by-age", path], text=True, capture_output=True) status = (Status.normal if process.returncode == 0 else Status.not_applicable) - return status, fill3.Text(termstr.TermStr.from_term( - process.stdout + process.stderr)) + return status, termstr.TermStr.from_term(process.stdout + process.stderr) @deps(deps={"git"}, url="https://git-scm.com/docs/git-log", @@ -419,8 +419,7 @@ def git_log(path): capture_output=True) status = (Status.normal if process.returncode == 0 else Status.not_applicable) - return status, fill3.Text(termstr.TermStr.from_term( - process.stdout + process.stderr)) + return status, termstr.TermStr.from_term(process.stdout + process.stderr) @deps(deps={"tidy"}, url="tidy", executables={"tidy"}) @@ -428,7 +427,7 @@ def html_syntax(path): # Maybe only show errors stdout, stderr, returncode = _do_command(["tidy", path]) status = Status.ok if returncode == 0 else Status.problem - return status, fill3.Text(stderr) + return status, stderr MAX_IMAGE_SIZE = 200 @@ -449,7 +448,7 @@ def _image_to_text(image): for row_index in range(image.height)] if image.height % 2 == 1: rows.append([None] * image.width) - return fill3.Fixed([ + return fill3.join("\n", [ termstr.TermStr(text, tuple(termstr.CharStyle( fg_color=top_pixel, bg_color=bottom_pixel) for top_pixel, bottom_pixel in zip(rows[index], @@ -484,7 +483,7 @@ def godoc(path): os.symlink(os.path.abspath(path), symlink_path) stdout, stderr, returncode = _do_command(["godoc", "."], cwd=temp_dir) os.remove(symlink_path) - return Status.normal, fill3.Text(stdout) + return Status.normal, stdout def make_tool_function(dependencies, command, url=None, success_status=None, @@ -695,9 +694,9 @@ def run_tool_no_error(path, tool): try: status, result = tool(path) except subprocess.TimeoutExpired: - status, result = Status.timed_out, fill3.Text("Timed out") + status, result = Status.timed_out, "Timed out" except UnicodeDecodeError: - status, result = Status.not_applicable, fill3.Text("Result not in UTF-8") + status, result = Status.not_applicable, "Result not in UTF-8" except: status, result = Status.error, _syntax_highlight( traceback.format_exc(), pygments.lexers.PythonTracebackLexer(), diff --git a/eris/worker.py b/eris/worker.py index dfe7c73..805282c 100755 --- a/eris/worker.py +++ b/eris/worker.py @@ -7,6 +7,7 @@ import asyncio import os import signal +import eris.fill3 as fill3 import eris.tools as tools @@ -86,7 +87,8 @@ def main(): tool_name, path = input(), input() tool = getattr(tools, tool_name) result = tools.Result(path, tool) - status, result.result = tools.run_tool_no_error(path, tool) + status, text = tools.run_tool_no_error(path, tool) + result.result = fill3.Text(text) print(status.value, flush=True) except: tools.log_error() diff --git a/tests/golden-files/results/bandit-hi3_py b/tests/golden-files/results/bandit-hi3_py index 2545b84..35a94d7 100644 --- a/tests/golden-files/results/bandit-hi3_py +++ b/tests/golden-files/results/bandit-hi3_py @@ -1,19 +1,19 @@ -Test results: - No issues identified. - -Code scanned: - Total lines of code: 2 +Test results: + No issues identified. + +Code scanned: + Total lines of code: 2 Total lines skipped (#nosec): 0 - -Run metrics: - Total issues (by severity): - Undefined: 0.0 - Low: 0.0 - Medium: 0.0 - High: 0.0 - Total issues (by confidence): - Undefined: 0.0 - Low: 0.0 - Medium: 0.0 - High: 0.0 -Files skipped (0): \ No newline at end of file + +Run metrics: + Total issues (by severity): + Undefined: 0.0 + Low: 0.0 + Medium: 0.0 + High: 0.0 + Total issues (by confidence): + Undefined: 0.0 + Low: 0.0 + Medium: 0.0 + High: 0.0 +Files skipped (0): diff --git a/tests/golden-files/results/html2text-hi_html b/tests/golden-files/results/html2text-hi_html index b6fc4c6..ce01362 100644 --- a/tests/golden-files/results/html2text-hi_html +++ b/tests/golden-files/results/html2text-hi_html @@ -1 +1 @@ -hello \ No newline at end of file +hello diff --git a/tests/golden-files/results/html_syntax-hi_html b/tests/golden-files/results/html_syntax-hi_html index fe612d0..fc80385 100644 --- a/tests/golden-files/results/html_syntax-hi_html +++ b/tests/golden-files/results/html_syntax-hi_html @@ -1,16 +1,16 @@ -line 1 column 1 - Warning: missing declaration -line 2 column 3 - Warning: inserting missing 'title' element -Info: Document content looks like HTML5 -Tidy found 2 warnings and 0 errors! - - -About HTML Tidy: https://github.com/htacg/tidy-html5 -Bug reports and comments: https://github.com/htacg/tidy-html5/issues -Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/ -Latest HTML specification: http://dev.w3.org/html5/spec-author-view/ -Validate your HTML documents: http://validator.w3.org/nu/ -Lobby your company to join the W3C: http://www.w3.org/Consortium - -Do you speak a language other than English, or a different variant of +line 1 column 1 - Warning: missing declaration +line 2 column 3 - Warning: inserting missing 'title' element +Info: Document content looks like HTML5 +Tidy found 2 warnings and 0 errors! + + +About HTML Tidy: https://github.com/htacg/tidy-html5 +Bug reports and comments: https://github.com/htacg/tidy-html5/issues +Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/ +Latest HTML specification: http://dev.w3.org/html5/spec-author-view/ +Validate your HTML documents: http://validator.w3.org/nu/ +Lobby your company to join the W3C: http://www.w3.org/Consortium + +Do you speak a language other than English, or a different variant of English? Consider helping us to localize HTML Tidy. For details please see -https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md \ No newline at end of file +https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md diff --git a/tests/golden-files/results/metadata-hi3_py b/tests/golden-files/results/metadata-hi3_py index 7da616e..f3a8f3e 100644 --- a/tests/golden-files/results/metadata-hi3_py +++ b/tests/golden-files/results/metadata-hi3_py @@ -1,15 +1,16 @@ -size: 12.0 B (12 bytes) -permissions: ?rwxr-xr-x (755) - +size: 12.0 B (12 bytes) +permissions: ?rwxr-xr-x (755) + modified time: Sun Jan 31 23:14:05 2016 (1454282045 secs) creation time: Sun Jan 31 23:14:05 2016 (1454282045 secs) access time: Sun Jan 31 23:14:07 2016 (1454282047 secs) - -owner: foo (1111 uid) -group: foo (1111 gid) - -hardlinks: 2 -symlink: no - -mime type: text/x-python; charset=us-ascii -file type: Python script, ASCII text executable  \ No newline at end of file + +owner: foo (1111 uid) +group: foo (1111 gid) + +hardlinks: 2 +symlink: no + +mime type: text/x-python; charset=us-ascii +file type: Python script, ASCII text executable + \ No newline at end of file diff --git a/tests/golden-files/results/nm-libieee_a b/tests/golden-files/results/nm-libieee_a index 6c028ff..6aa757c 100644 --- a/tests/golden-files/results/nm-libieee_a +++ b/tests/golden-files/results/nm-libieee_a @@ -1 +1 @@ -00000000 D _LIB_VERSION \ No newline at end of file +00000000 D _LIB_VERSION diff --git a/tests/golden-files/results/nm-libpcprofile_so b/tests/golden-files/results/nm-libpcprofile_so index 86ed4c3..1f859ac 100644 --- a/tests/golden-files/results/nm-libpcprofile_so +++ b/tests/golden-files/results/nm-libpcprofile_so @@ -1 +1 @@ -nm: ./input/libpcprofile.so: no symbols \ No newline at end of file +nm: ./input/libpcprofile.so: no symbols diff --git a/tests/golden-files/results/objdump_disassemble-Mcrt1_o b/tests/golden-files/results/objdump_disassemble-Mcrt1_o index cfbb89f..b172ccf 100644 --- a/tests/golden-files/results/objdump_disassemble-Mcrt1_o +++ b/tests/golden-files/results/objdump_disassemble-Mcrt1_o @@ -1,5 +1,5 @@ - -./input/Mcrt1.o: file format elf32-i386 - + +./input/Mcrt1.o: file format elf32-i386 + objdump: ./input/Mcrt1.o: not a dynamic object -objdump: ./input/Mcrt1.o: invalid operation \ No newline at end of file +objdump: ./input/Mcrt1.o: invalid operation diff --git a/tests/golden-files/results/objdump_headers-Mcrt1_o b/tests/golden-files/results/objdump_headers-Mcrt1_o index 8c1185b..fcff6aa 100644 --- a/tests/golden-files/results/objdump_headers-Mcrt1_o +++ b/tests/golden-files/results/objdump_headers-Mcrt1_o @@ -1,23 +1,23 @@ - -./input/Mcrt1.o: file format elf32-i386 -./input/Mcrt1.o -architecture: i386, flags 0x00000000: - -start address 0x00000000 - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .text 00000000 00000000 00000000 00000034 2**0 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .data 00000000 00000000 00000000 00000034 2**0 - CONTENTS, ALLOC, LOAD, DATA - 2 .bss 00000000 00000000 00000000 00000034 2**0 - ALLOC + +./input/Mcrt1.o: file format elf32-i386 +./input/Mcrt1.o +architecture: i386, flags 0x00000000: + +start address 0x00000000 + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 00000000 00000000 00000000 00000034 2**0 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .data 00000000 00000000 00000000 00000034 2**0 + CONTENTS, ALLOC, LOAD, DATA + 2 .bss 00000000 00000000 00000000 00000034 2**0 + ALLOC 3 .note.GNU-stack 00000000 00000000 00000000 00000034 2**0 - CONTENTS, READONLY - 4 .gnu_debuglink 0000000c 00000000 00000000 00000034 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -no symbols - - \ No newline at end of file + CONTENTS, READONLY + 4 .gnu_debuglink 0000000c 00000000 00000000 00000034 2**0 + CONTENTS, READONLY +SYMBOL TABLE: +no symbols + + diff --git a/tests/golden-files/results/pdf2txt-standard_pdf b/tests/golden-files/results/pdf2txt-standard_pdf index cbc5f8c..9e70155 100644 --- a/tests/golden-files/results/pdf2txt-standard_pdf +++ b/tests/golden-files/results/pdf2txt-standard_pdf @@ -1,3 +1,3 @@ Cover Page - -# \ No newline at end of file + +# \ No newline at end of file diff --git a/tests/golden-files/results/perl_syntax-perl_pl b/tests/golden-files/results/perl_syntax-perl_pl index 3b5cc25..845b743 100644 --- a/tests/golden-files/results/perl_syntax-perl_pl +++ b/tests/golden-files/results/perl_syntax-perl_pl @@ -1 +1 @@ -./input/perl.pl syntax OK \ No newline at end of file +./input/perl.pl syntax OK diff --git a/tests/golden-files/results/perldoc-contents_pod b/tests/golden-files/results/perldoc-contents_pod index 20bcbb9..2513864 100644 --- a/tests/golden-files/results/perldoc-contents_pod +++ b/tests/golden-files/results/perldoc-contents_pod @@ -1,70 +1,70 @@ -Net::Z3950::AsyncZ - Intro +Net::Z3950::AsyncZ + Intro Net::Z3950::AsyncZ adds an additional layer of asynchronous support for - the Z3950 module through the use of multiple forked processes. I hope - that users will also find that it provides a convenient front end to + the Z3950 module through the use of multiple forked processes. I hope + that users will also find that it provides a convenient front end to "Net::Z3950". My initial idea was to write something that would provide a convenient means of processing and formatting Z39.50 records--which I - did, using the "Z3950" synchronous code. But I also wanted something - that could handle queries to large numbers of servers at one session. + did, using the "Z3950" synchronous code. But I also wanted something + that could handle queries to large numbers of servers at one session. Working on this part of my project, I found that I had trouble with the - "Z3950" asynchronous features and so ended up with what I have here. - - I give a more detailed account in in the DESCRIPTION section of - "AsyncZ.pod". - - Documentation - AsyncZ.pod - This is the starting point--it gives an overview of the AsyncZ + "Z3950" asynchronous features and so ended up with what I have here. + + I give a more detailed account in in the DESCRIPTION section of + "AsyncZ.pod". + + Documentation + AsyncZ.pod + This is the starting point--it gives an overview of the AsyncZ module, describes the basic mechanics of its asynchronous workings, - and details the particulars of the objects and methods. But see - ""Examples.pod" for detailed explanations of the sample scripts - which come with the "Net::Z3950::AsyncZ" distribution. - - Options.pod + and details the particulars of the objects and methods. But see + ""Examples.pod" for detailed explanations of the sample scripts + which come with the "Net::Z3950::AsyncZ" distribution. + + Options.pod This document details the various options that can be set to modify - the behavior of AsyncZ Index - - Report.pod - Report.pod deals with how records are treated line by line and how - you can affect the apearance of a record's line by line output - - Examples.pod - This document goes through the sample scripts that come with the - "Net::Z3950::AsyncZ" distribution and annotates them in a - line-by-line fashion. It's a basic HOW-TO. - - The Modules + the behavior of AsyncZ Index + + Report.pod + Report.pod deals with how records are treated line by line and how + you can affect the apearance of a record's line by line output + + Examples.pod + This document goes through the sample scripts that come with the + "Net::Z3950::AsyncZ" distribution and annotates them in a + line-by-line fashion. It's a basic HOW-TO. + + The Modules There are more modules than there is documentation. The reason for this - is that the only module you have full and complete access to is - "Net::Z3950::AsyncZ". The other modules are either internal to - "Net::AsyncZ" or accessed indirectly or in part indirectly. - - Here are the modules: - Net::Z3950::AsyncZ - The main module: direct access --documented in "AsyncZ" and - "Options" documentation - - Net::Z3950::AsyncZ::ErrMsg - User error message handling: indirect access -- documented in - "AsyncZ" documentation - - Net::Z3950::AsyncZ::Errors - Error handling for debugging: limited access -- documented in - "AsyncZ" documentation - - Net::Z3950::AsyncZ::Report - Module reponsible for fetching and formatting records: limited - access -- documented - - Net::Z3950::AsyncZ::ZLoop - Event loop for child processes: no access -- not documented - - Net::Z3950::AsyncZ::ZSend + is that the only module you have full and complete access to is + "Net::Z3950::AsyncZ". The other modules are either internal to + "Net::AsyncZ" or accessed indirectly or in part indirectly. + + Here are the modules: + Net::Z3950::AsyncZ + The main module: direct access --documented in "AsyncZ" and + "Options" documentation + + Net::Z3950::AsyncZ::ErrMsg + User error message handling: indirect access -- documented in + "AsyncZ" documentation + + Net::Z3950::AsyncZ::Errors + Error handling for debugging: limited access -- documented in + "AsyncZ" documentation + + Net::Z3950::AsyncZ::Report + Module reponsible for fetching and formatting records: limited + access -- documented + + Net::Z3950::AsyncZ::ZLoop + Event loop for child processes: no access -- not documented + + Net::Z3950::AsyncZ::ZSend Connection details for child processes: no access -- not documented - - Net::Z3950::AsyncZ::Options::_params - Options for child processes: direct and indirect access -- - documented in "Options" and "AsyncZ" documentation - -INDEX \ No newline at end of file + + Net::Z3950::AsyncZ::Options::_params + Options for child processes: direct and indirect access -- + documented in "Options" and "AsyncZ" documentation + +INDEX diff --git a/tests/golden-files/results/perldoc-perl_pl b/tests/golden-files/results/perldoc-perl_pl index df365cd..6d0458d 100644 --- a/tests/golden-files/results/perldoc-perl_pl +++ b/tests/golden-files/results/perldoc-perl_pl @@ -1 +1 @@ -No documentation found for "./input/perl.pl". \ No newline at end of file +No documentation found for "./input/perl.pl". diff --git a/tests/golden-files/results/php7_syntax-root_php b/tests/golden-files/results/php7_syntax-root_php index 6aea4f9..1d12a68 100644 --- a/tests/golden-files/results/php7_syntax-root_php +++ b/tests/golden-files/results/php7_syntax-root_php @@ -1 +1 @@ -No syntax errors detected in ./input/root.php \ No newline at end of file +No syntax errors detected in ./input/root.php diff --git a/tests/golden-files/results/pydoc-hi3_py b/tests/golden-files/results/pydoc-hi3_py index 38bdadc..bfd3ae0 100644 --- a/tests/golden-files/results/pydoc-hi3_py +++ b/tests/golden-files/results/pydoc-hi3_py @@ -1,12 +1,12 @@ Help on module hi3: - -NAME - hi3 - -FUNCTIONS - hi() - -FILE - input/hi3.py - - \ No newline at end of file + +NAME + hi3 + +FUNCTIONS + hi() + +FILE + input/hi3.py + + diff --git a/tests/golden-files/results/python_coverage-hi3_py b/tests/golden-files/results/python_coverage-hi3_py index 169f20b..dcf113c 100644 --- a/tests/golden-files/results/python_coverage-hi3_py +++ b/tests/golden-files/results/python_coverage-hi3_py @@ -1,4 +1,5 @@ - - -> def hi(): -> print("hi") \ No newline at end of file + + +> def hi(): +> print("hi") + \ No newline at end of file diff --git a/tests/golden-files/results/python_mccabe-hi3_py b/tests/golden-files/results/python_mccabe-hi3_py index 43794b8..83a3b56 100644 --- a/tests/golden-files/results/python_mccabe-hi3_py +++ b/tests/golden-files/results/python_mccabe-hi3_py @@ -1 +1 @@ -3:0: 'hi' 1 \ No newline at end of file +3:0: 'hi' 1 diff --git a/tests/golden-files/results/python_modulefinder-hi3_py b/tests/golden-files/results/python_modulefinder-hi3_py index 5dd3adc..3ba6ab5 100644 --- a/tests/golden-files/results/python_modulefinder-hi3_py +++ b/tests/golden-files/results/python_modulefinder-hi3_py @@ -1,4 +1,4 @@ - - Name File - ---- ---- -m __main__ ./input/hi3.py \ No newline at end of file + + Name File + ---- ---- +m __main__ ./input/hi3.py diff --git a/tests/golden-files/results/readelf-Mcrt1_o b/tests/golden-files/results/readelf-Mcrt1_o index c63a04b..0d08efa 100644 --- a/tests/golden-files/results/readelf-Mcrt1_o +++ b/tests/golden-files/results/readelf-Mcrt1_o @@ -1,47 +1,47 @@ -ELF Header: - Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 - Class: ELF32 - Data: 2's complement, little endian - Version: 1 (current) - OS/ABI: UNIX - System V - ABI Version: 0 - Type: REL (Relocatable file) - Machine: Intel 80386 - Version: 0x1 - Entry point address: 0x0 - Start of program headers: 0 (bytes into file) - Start of section headers: 124 (bytes into file) - Flags: 0x0 - Size of this header: 52 (bytes) - Size of program headers: 0 (bytes) - Number of program headers: 0 - Size of section headers: 40 (bytes) - Number of section headers: 7 - Section header string table index: 6 - -Section Headers: - [Nr] Name Type Addr Off Size ES Flg Lk Inf Al - [ 0] NULL 00000000 000000 000000 00 0 0 0 - [ 1] .text PROGBITS 00000000 000034 000000 00 AX 0 0 1 - [ 2] .data PROGBITS 00000000 000034 000000 00 WA 0 0 1 - [ 3] .bss NOBITS 00000000 000034 000000 00 WA 0 0 1 - [ 4] .note.GNU-stack PROGBITS 00000000 000034 000000 00 0 0 1 - [ 5] .gnu_debuglink PROGBITS 00000000 000034 00000c 00 0 0 1 - [ 6] .shstrtab STRTAB 00000000 000040 00003b 00 0 0 1 -Key to Flags: - W (write), A (alloc), X (execute), M (merge), S (strings), I (info), - L (link order), O (extra OS processing required), G (group), T (TLS), - C (compressed), x (unknown), o (OS specific), E (exclude), - p (processor specific) - -There are no section groups in this file. - -There are no program headers in this file. - -There is no dynamic section in this file. - -There are no relocations in this file. - +ELF Header: + Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF32 + Data: 2's complement, little endian + Version: 1 (current) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: REL (Relocatable file) + Machine: Intel 80386 + Version: 0x1 + Entry point address: 0x0 + Start of program headers: 0 (bytes into file) + Start of section headers: 124 (bytes into file) + Flags: 0x0 + Size of this header: 52 (bytes) + Size of program headers: 0 (bytes) + Number of program headers: 0 + Size of section headers: 40 (bytes) + Number of section headers: 7 + Section header string table index: 6 + +Section Headers: + [Nr] Name Type Addr Off Size ES Flg Lk Inf Al + [ 0] NULL 00000000 000000 000000 00 0 0 0 + [ 1] .text PROGBITS 00000000 000034 000000 00 AX 0 0 1 + [ 2] .data PROGBITS 00000000 000034 000000 00 WA 0 0 1 + [ 3] .bss NOBITS 00000000 000034 000000 00 WA 0 0 1 + [ 4] .note.GNU-stack PROGBITS 00000000 000034 000000 00 0 0 1 + [ 5] .gnu_debuglink PROGBITS 00000000 000034 00000c 00 0 0 1 + [ 6] .shstrtab STRTAB 00000000 000040 00003b 00 0 0 1 +Key to Flags: + W (write), A (alloc), X (execute), M (merge), S (strings), I (info), + L (link order), O (extra OS processing required), G (group), T (TLS), + C (compressed), x (unknown), o (OS specific), E (exclude), + p (processor specific) + +There are no section groups in this file. + +There are no program headers in this file. + +There is no dynamic section in this file. + +There are no relocations in this file. + The decoding of unwind sections for machine type Intel 80386 is not currently supported. - -No version information found in this file. \ No newline at end of file + +No version information found in this file. diff --git a/tests/golden-files/results/tar_bz2-hi_tar_bz2 b/tests/golden-files/results/tar_bz2-hi_tar_bz2 index d8504f7..f8f15e8 100644 --- a/tests/golden-files/results/tar_bz2-hi_tar_bz2 +++ b/tests/golden-files/results/tar_bz2-hi_tar_bz2 @@ -1 +1 @@ --rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py \ No newline at end of file +-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py diff --git a/tests/golden-files/results/tar_gz-hi_tar_gz b/tests/golden-files/results/tar_gz-hi_tar_gz index d8504f7..f8f15e8 100644 --- a/tests/golden-files/results/tar_gz-hi_tar_gz +++ b/tests/golden-files/results/tar_gz-hi_tar_gz @@ -1 +1 @@ --rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py \ No newline at end of file +-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py diff --git a/tests/golden-files/results/tar_gz-hi_tgz b/tests/golden-files/results/tar_gz-hi_tgz index d8504f7..f8f15e8 100644 --- a/tests/golden-files/results/tar_gz-hi_tgz +++ b/tests/golden-files/results/tar_gz-hi_tgz @@ -1 +1 @@ --rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py \ No newline at end of file +-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py diff --git a/tests/golden-files/results/zipinfo-hi_zip b/tests/golden-files/results/zipinfo-hi_zip index 7679bcf..235c424 100644 --- a/tests/golden-files/results/zipinfo-hi_zip +++ b/tests/golden-files/results/zipinfo-hi_zip @@ -1,4 +1,4 @@ -Archive: ./input/hi.zip -Zip file size: 187 bytes, number of entries: 1 +Archive: ./input/hi.zip +Zip file size: 187 bytes, number of entries: 1 -rw-rw-r-- 3.0 unx 27 tx stor 16-Feb-09 21:50 hi.py -1 file, 27 bytes uncompressed, 27 bytes compressed: 0.0% \ No newline at end of file +1 file, 27 bytes uncompressed, 27 bytes compressed: 0.0% diff --git a/tests/tools_test.py b/tests/tools_test.py index 5c4f5e9..ea8d52b 100755 --- a/tests/tools_test.py +++ b/tests/tools_test.py @@ -64,7 +64,7 @@ class ToolsTestCase(unittest.TestCase): with self.subTest(input_filename=input_filename): status, result = run_tool(tool, input_filename) golden_path = result_path(tool, input_filename) - golden.assertGolden(widget_to_string(result), golden_path) + golden.assertGolden(str(result), golden_path) self.assertEqual(status, expected_status) def test_metadata(self):