[testsuite] Use system_tests.path() in some test cases

This commit is contained in:
Dan Čermák
2018-05-28 00:38:57 +02:00
parent 4e32929956
commit 23e29e9527
4 changed files with 23 additions and 26 deletions
+6 -7
View File
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
import system_tests
import os.path
from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
class TestFirstPoC(metaclass=system_tests.CaseMeta):
class TestFirstPoC(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/283
@@ -16,16 +16,15 @@ class TestFirstPoC(metaclass=system_tests.CaseMeta):
Here we want to also check that the two last lines of got_stderr have the expected_stderr
"""
system_tests.check_no_ASAN_UBSAN_errors(self, i, command, got_stderr, expected_stderr)
check_no_ASAN_UBSAN_errors(self, i, command, got_stderr, expected_stderr)
self.assertListEqual(expected_stderr.splitlines(), got_stderr.splitlines()[-2:])
filename = os.path.join("$data_path", "pocIssue283.jpg")
filename = path("$data_path/pocIssue283.jpg")
commands = ["$exiv2 $filename"]
stdout = [""]
stderr = [
"""$exiv2_exception_message """ + filename + """:
"""$exiv2_exception_message $filename:
$kerCorruptedMetadata
"""]
compare_stderr = check_no_ASAN_UBSAN_errors
retval = [1]
+5 -5
View File
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
import system_tests
from system_tests import CaseMeta, path
class CanonEOSM100(metaclass=system_tests.CaseMeta):
class CanonEOSM100(metaclass=CaseMeta):
filename = "$data_path/exiv2-pr317.exv"
filename = path("$data_path/exiv2-pr317.exv")
commands = ["$exiv2 -pa --grep model/i $filename"]
stdout = ["""Exif.Image.Model Ascii 15 Canon EOS M100
Exif.Canon.ModelID Long 1 EOS M100
Exif.Photo.LensModel Ascii 29 EF-M15-45mm f/3.5-6.3 IS STM
"""
]
]
stderr = [""]
retval = [0]
retval = [0]