Skip to content

Commit

Permalink
tests: fix parsing w/ path containing "-pa" or "-pS"
Browse files Browse the repository at this point in the history
The OutputTagExtract test case for tiff_test runs exiv2 two times,
with "-pa" and "-pS", and parses their outputs. To know which output to
parse, it checks for "-pa" and "-pS" in the string of the command being
run; considering that the command string contains the full path to the
test data, which is a subdirectory of the sources, this means that a
wrong parser will be used in case the full source path contains any of
"-pa" or "-pS" (e.g. "/build/some-path/exiv2/...").

Cheap fix for this: since "-pa"/"-pS" are options in the command string,
check for them using spaces around.
  • Loading branch information
pinotree authored and kmilos committed Nov 12, 2023
1 parent 9002797 commit 5f4ffdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/tiff_test/test_tag_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def compare_pS_pa(self):
def compare_stdout(self, i, command, got_stdout, expected_stdout):
super().compare_stdout(i, command, got_stdout, expected_stdout)

if '-pa' in command:
if ' -pa ' in command:
self.pa_data = self.parse_pa(got_stdout.splitlines())
if '-pS' in command:
if ' -pS ' in command:
self.pS_data = self.parse_pS(got_stdout.splitlines())

if i == 1:
Expand Down

0 comments on commit 5f4ffdd

Please sign in to comment.