Blame tests/bugfixes/github/test_issue_1099.py

Packit Service fb147c
# -*- coding: utf-8 -*-
Packit Service fb147c
Packit Service fb147c
from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
Packit Service fb147c
Packit Service fb147c
Packit Service fb147c
class EmptyValueInCommandFile(metaclass=CaseMeta):
Packit Service fb147c
    """
Packit Service fb147c
    Regression test for the bug described in:
Packit Service fb147c
    https://github.com/Exiv2/exiv2/issues/1099
Packit Service fb147c
Packit Service fb147c
    An empty value in the command file causes a std::out_of_range exception.
Packit Service fb147c
    """
Packit Service fb147c
    url = "https://github.com/Exiv2/exiv2/issues/1099"
Packit Service fb147c
Packit Service fb147c
    filename1 = path("$data_path/issue_1099_poc.txt")
Packit Service fb147c
    filename2 = path("$data_path/issue_1099_poc.bin")
Packit Service fb147c
    commands = ["$exiv2 -m $filename1 mo $filename2"]
Packit Service fb147c
Packit Service fb147c
    stderr = [
Packit Service fb147c
        """$filename1, line 1: Empty value for key `Exiff.LfkInfo.GPSDa'
Packit Service fb147c
$exiv2exe: Error parsing -m option arguments
Packit Service fb147c
"""]
Packit Service fb147c
    retval = [1]
Packit Service fb147c
Packit Service fb147c
    def compare_stdout(self, i, command, got_stdout, expected_stdout):
Packit Service fb147c
        """ We don't care about the stdout, just don't crash """
Packit Service fb147c
        pass