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

v0.27.3
Dan Čermák 7 years ago
parent 4e32929956
commit 23e29e9527

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import system_tests from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
import os.path
class TestFirstPoC(metaclass=system_tests.CaseMeta):
class TestFirstPoC(metaclass=CaseMeta):
""" """
Regression test for the bug described in: Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/283 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 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:]) 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"] commands = ["$exiv2 $filename"]
stdout = [""] stdout = [""]
stderr = [ stderr = [
"""$exiv2_exception_message """ + filename + """: """$exiv2_exception_message $filename:
$kerCorruptedMetadata $kerCorruptedMetadata
"""] """]
compare_stderr = check_no_ASAN_UBSAN_errors compare_stderr = check_no_ASAN_UBSAN_errors
retval = [1] retval = [1]

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- 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"] commands = ["$exiv2 -pa --grep model/i $filename"]
stdout = ["""Exif.Image.Model Ascii 15 Canon EOS M100 stdout = ["""Exif.Image.Model Ascii 15 Canon EOS M100

@ -1,17 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import system_tests from system_tests import DeleteFiles, CopyFiles, CaseMeta, path
import os.path
@system_tests.DeleteFiles("$xmpname") @DeleteFiles("$xmpname")
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg") @CopyFiles("$data_path/exiv2-empty.jpg")
class AdobeXmpNamespace(metaclass=system_tests.CaseMeta): class AdobeXmpNamespace(metaclass=CaseMeta):
url = "http://dev.exiv2.org/issues/751" url = "http://dev.exiv2.org/issues/751"
filename = os.path.join("$data_path", "exiv2-empty_copy.jpg") filename = path("$data_path/exiv2-empty_copy.jpg")
xmpname = os.path.join("$data_path", "exiv2-empty_copy.xmp") xmpname = path("$data_path/exiv2-empty_copy.xmp")
commands = [ commands = [
"""$exiv2 -v -M"reg imageapp orig/" -M "set Xmp.imageapp.uuid abcd" $filename""", """$exiv2 -v -M"reg imageapp orig/" -M "set Xmp.imageapp.uuid abcd" $filename""",

@ -1,19 +1,18 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import system_tests from system_tests import DeleteFiles, CopyFiles, CaseMeta, path
import os
@system_tests.DeleteFiles("$xmpfile") @DeleteFiles("$xmpfile")
@system_tests.CopyFiles("$data_path/exiv2-empty.jpg") @CopyFiles("$data_path/exiv2-empty.jpg")
class WrongXmpTypeForNestedXmpKeys(metaclass=system_tests.CaseMeta): class WrongXmpTypeForNestedXmpKeys(metaclass=CaseMeta):
url = "http://dev.exiv2.org/issues/$num" url = "http://dev.exiv2.org/issues/$num"
num = 799 num = 799
cmdfile = os.path.join("$data_path", "bug$num.cmd") cmdfile = path("$data_path/bug$num.cmd")
filename_common = os.path.join("$data_path", "exiv2-empty_copy") filename_common = path("$data_path/exiv2-empty_copy")
filename = "$filename_common.jpg" filename = "$filename_common.jpg"
xmpfile = "$filename_common.xmp" xmpfile = "$filename_common.xmp"

Loading…
Cancel
Save