quixote.inspection.diff package

Module contents

class quixote.inspection.diff.DiffFormat(value)[source]

An enumeration.

CONTEXT = 0
UNIFIED = 1
quixote.inspection.diff.diff(file1: str, file2: str, *, brief: bool = False, report_identical: bool = False, recursive: bool = False, absent_as_empty: bool = False, ignore_case: bool = False, ignore_tab_expansion: bool = False, ignore_trailing_space: bool = False, ignore_space_amount: bool = False, ignore_whitespace: bool = False, ignore_blank_lines: bool = False, treat_as_text: bool = False, output_format: Optional[quixote.inspection.diff.DiffFormat] = None) quixote.inspection.exec.CompletedProcess[source]

Use the diff(1) command to compare files line by line

Parameters
  • file1 – the first file to consider

  • file2 – the second file to consider

  • brief – whether the details of the comparison should be omitted (default is False, see diff -q)

  • report_identical – whether identical files should be reported (default is False, see diff -s)

  • recursive – whether directories should be recursively compared (default is False, see diff -r)

  • absent_as_empty – whether absent files should be treated as empty (default is False, see diff -N)

  • ignore_case – whether case in the files contents should be ignored (default is False, see diff -i)

  • ignore_tab_expansion – whether tab expansion should be ignored (default is False, see diff -E)

  • ignore_trailing_space – whether trailing white space should be ignored (default is False, see diff -Z)

  • ignore_space_amount – whether the amount of white space should be ignored (default is False, see diff -b)

  • ignore_whitespace – whether all the white space should be ignored (default is False, see diff -w)

  • ignore_blank_lines – whether blank lines should be ignored (default is False, see diff -B)

  • treat_as_text – whether file contents should be treated as text, or automatically detected (default is False, see diff -a)

  • output_format – the format to use to display the results (default is CONTEXT, see diff -c and diff -u)

quixote.inspection.diff.diff_bytes(bytes1: bytes, bytes2: bytes, *, brief: bool = False, report_identical: bool = False, ignore_case: bool = False, ignore_tab_expansion: bool = False, ignore_trailing_space: bool = False, ignore_space_amount: bool = False, ignore_whitespace: bool = False, ignore_blank_lines: bool = False, treat_as_text: bool = False, output_format: Optional[quixote.inspection.diff.DiffFormat] = None) quixote.inspection.exec.CompletedProcess[source]

Use the diff(1) command to compare two byte-objects

Parameters
  • bytes1 – the first byte-object to consider

  • bytes2 – the second byte-object to consider

  • brief – whether the details of the comparison should be omitted (default is False, see diff -q)

  • report_identical – whether identical files should be reported (default is False, see diff -s)

  • ignore_case – whether case in the files contents should be ignored (default is False, see diff -i)

  • ignore_tab_expansion – whether tab expansion should be ignored (default is False, see diff -E)

  • ignore_trailing_space – whether trailing white space should be ignored (default is False, see diff -Z)

  • ignore_space_amount – whether the amount of white space should be ignored (default is False, see diff -b)

  • ignore_whitespace – whether all the white space should be ignored (default is False, see diff -w)

  • ignore_blank_lines – whether blank lines should be ignored (default is False, see diff -B)

  • treat_as_text – whether file contents should be treated as text, or automatically detected (default is False, see diff -a)

  • output_format – the format to use to display the results (default is CONTEXT, see diff -c and diff -u)

quixote.inspection.diff.diff_strings(str1: str, str2: str, *, brief: bool = False, report_identical: bool = False, ignore_case: bool = False, ignore_tab_expansion: bool = False, ignore_trailing_space: bool = False, ignore_space_amount: bool = False, ignore_whitespace: bool = False, ignore_blank_lines: bool = False, output_format: Optional[quixote.inspection.diff.DiffFormat] = None) quixote.inspection.exec.CompletedProcess[source]

Use the diff(1) command to compare two strings line by line

Parameters
  • str1 – the first string to consider

  • str2 – the second string to consider

  • brief – whether the details of the comparison should be omitted (default is False, see diff -q)

  • report_identical – whether identical files should be reported (default is False, see diff -s)

  • ignore_case – whether case in the files contents should be ignored (default is False, see diff -i)

  • ignore_tab_expansion – whether tab expansion should be ignored (default is False, see diff -E)

  • ignore_trailing_space – whether trailing white space should be ignored (default is False, see diff -Z)

  • ignore_space_amount – whether the amount of white space should be ignored (default is False, see diff -b)

  • ignore_whitespace – whether all the white space should be ignored (default is False, see diff -w)

  • ignore_blank_lines – whether blank lines should be ignored (default is False, see diff -B)

  • output_format – the format to use to display the results (default is CONTEXT, see diff -c and diff -u)

quixote.inspection.diff.diff_exec(exec1: Union[str, List[str]], exec2: Union[str, List[str]], *, arguments: Optional[List[str]] = None, second_arguments: Optional[List[str]] = None, brief: bool = False, report_identical: bool = False, ignore_case: bool = False, ignore_tab_expansion: bool = False, ignore_trailing_space: bool = False, ignore_space_amount: bool = False, ignore_whitespace: bool = False, ignore_blank_lines: bool = False, treat_as_text: bool = False, output_format: Optional[quixote.inspection.diff.DiffFormat] = None, timeout: Optional[int] = None, redirect_stderr_in_stdout: bool = False, env: Optional[Mapping[str, str]] = None, allowed_status: Union[int, List[int]] = 0) quixote.inspection.exec.CompletedProcess[source]

Use the diff(1) command to compare the output of two executables line by line

Parameters
  • exec1 – the first executable to consider

  • exec2 – the second executable to consider

  • arguments – the argument list to give to the executables (default is None, to give no arguments)

  • second_arguments – the argument list to give to the second executable (default is None, to use the value of arguments)

  • brief – whether the details of the comparison should be omitted (default is False, see diff -q)

  • report_identical – whether identical files should be reported (default is False, see diff -s)

  • ignore_case – whether case in the files contents should be ignored (default is False, see diff -i)

  • ignore_tab_expansion – whether tab expansion should be ignored (default is False, see diff -E)

  • ignore_trailing_space – whether trailing white space should be ignored (default is False, see diff -Z)

  • ignore_space_amount – whether the amount of white space should be ignored (default is False, see diff -b)

  • ignore_whitespace – whether all the white space should be ignored (default is False, see diff -w)

  • ignore_blank_lines – whether blank lines should be ignored (default is False, see diff -B)

  • treat_as_text – whether file contents should be treated as text, or automatically detected (default is False, see diff -a)

  • output_format – the format to use to display the results (default is CONTEXT, see diff -c and diff -u)

  • timeout – the timeout in seconds after which processes should be killed

  • redirect_stderr_in_stdout – whether stderr should be redirected in stdout for both executables

  • env – the environment to pass to the executables

  • allowed_status – status or list of statuses considered successful for both executables

Raises
  • quixote.inspection.KOError – if one of the executables’ return status doesn’t match one of the allowed statuses

  • quixote.inspection.TiemoutError – if timeout is not None and expires before a child process terminates