Blame tests/bugfixes/redmine/test_issue_1242.py

Packit Service 21b5d1
# -*- coding: utf-8 -*-
Packit Service 21b5d1
Packit Service 21b5d1
import system_tests
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
class CheckShutterInPentax(metaclass=system_tests.CaseMeta):
Packit Service 21b5d1
Packit Service 21b5d1
    url = "http://dev.exiv2.org/issues/1242"
Packit Service 21b5d1
    filename = "$data_path/Reagan.jp2"
Packit Service 21b5d1
Packit Service 21b5d1
    commands = ["$exiv2 -pa $filename"]
Packit Service 21b5d1
Packit Service 21b5d1
    stdout = [r"""Exif.Image.ImageDescription                  Ascii     403  040621-N-6536T-062
Packit Service 21b5d1
USS Ronald Reagan (CVN 76), June 21, 2004 -  USS Ronald Reagan (CVN 76) sails through the Straits of Magellan on its way to the Pacific Ocean. The Navyís newest aircraft carrier is underway circumnavigating South America in transit to its new homeport of San Diego. U.S. Navy photo by Photographerís Mate 3rd Class (AW) Elizabeth Thompson. (RELEASE)
Packit Service 21b5d1
                               
Packit Service 21b5d1
Exif.Image.Make                              Ascii      18  NIKON CORPORATION
Packit Service 21b5d1
Exif.Image.Model                             Ascii      10  NIKON D1X
Packit Service 21b5d1
Exif.Image.Orientation                       Short       1  top, left
Packit Service 21b5d1
Exif.Image.XResolution                       Rational    1  300
Packit Service 21b5d1
Exif.Image.YResolution                       Rational    1  300
Packit Service 21b5d1
Exif.Image.ResolutionUnit                    Short       1  inch
Packit Service 21b5d1
Exif.Image.Software                          Ascii      40  Adobe Photoshop Elements 12.0 Macintosh
Packit Service 21b5d1
Exif.Image.DateTime                          Ascii      20  2016:09:13 11:58:16
Packit Service 21b5d1
Exif.Image.Artist                            Ascii      34  Photographerís Mate 3rd Class (A
Packit Service 21b5d1
Exif.Image.YCbCrPositioning                  Short       1  Centered
Packit Service 21b5d1
Exif.Image.ExifTag                           Long        1  712
Packit Service 21b5d1
Exif.Photo.ExposureTime                      Rational    1  1/125 s
Packit Service 21b5d1
Exif.Photo.FNumber                           Rational    1  F5
Packit Service 21b5d1
Exif.Photo.ExposureProgram                   Short       1  Manual
Packit Service 21b5d1
Exif.Photo.ExifVersion                       Undefined   4  2.20
Packit Service 21b5d1
Exif.Photo.DateTimeOriginal                  Ascii      20  2004:06:21 23:37:53
Packit Service 21b5d1
Exif.Photo.DateTimeDigitized                 Ascii      20  2004:06:21 23:37:53
Packit Service 21b5d1
Exif.Photo.ComponentsConfiguration           Undefined   4  YCbCr
Packit Service 21b5d1
Exif.Photo.ShutterSpeedValue                 SRational   1  1/125 s
Packit Service 21b5d1
Exif.Photo.ApertureValue                     Rational    1  F5
Packit Service 21b5d1
Exif.Photo.ExposureBiasValue                 SRational   1  +1/3 EV
Packit Service 21b5d1
Exif.Photo.MaxApertureValue                  Rational    1  F2.8
Packit Service 21b5d1
Exif.Photo.MeteringMode                      Short       1  Center weighted average
Packit Service 21b5d1
Exif.Photo.LightSource                       Short       1  Cloudy weather
Packit Service 21b5d1
Exif.Photo.Flash                             Short       1  No flash
Packit Service 21b5d1
Exif.Photo.FocalLength                       Rational    1  42.0 mm
Packit Service 21b5d1
Exif.Photo.SubSecTime                        Ascii       3  06
Packit Service 21b5d1
Exif.Photo.SubSecTimeOriginal                Ascii       3  06
Packit Service 21b5d1
Exif.Photo.SubSecTimeDigitized               Ascii       3  06
Packit Service 21b5d1
Exif.Photo.FlashpixVersion                   Undefined   4  1.00
Packit Service 21b5d1
Exif.Photo.ColorSpace                        Short       1  Uncalibrated
Packit Service 21b5d1
Exif.Photo.PixelXDimension                   Short       1  200
Packit Service 21b5d1
Exif.Photo.PixelYDimension                   Short       1  130
Packit Service 21b5d1
Exif.Photo.SensingMethod                     Short       1  One-chip color area
Packit Service 21b5d1
Exif.Photo.FileSource                        Undefined   1  Digital still camera
Packit Service 21b5d1
Exif.Photo.SceneType                         Undefined   1  Directly photographed
Packit Service 21b5d1
Exif.Photo.CustomRendered                    Short       1  Normal process
Packit Service 21b5d1
Exif.Photo.ExposureMode                      Short       1  Manual
Packit Service 21b5d1
Exif.Photo.WhiteBalance                      Short       1  Manual
Packit Service 21b5d1
Exif.Photo.DigitalZoomRatio                  Rational    1  1.0
Packit Service 21b5d1
Exif.Photo.FocalLengthIn35mmFilm             Short       1  63.0 mm
Packit Service 21b5d1
Exif.Photo.SceneCaptureType                  Short       1  Standard
Packit Service 21b5d1
Exif.Photo.GainControl                       Short       1  None
Packit Service 21b5d1
Exif.Photo.Contrast                          Short       1  Normal
Packit Service 21b5d1
Exif.Photo.Saturation                        Short       1  Normal
Packit Service 21b5d1
Exif.Photo.Sharpness                         Short       1  Normal
Packit Service 21b5d1
Exif.Photo.SubjectDistanceRange              Short       1  Unknown
Packit Service 21b5d1
Exif.Photo.ImageUniqueID                     Ascii      33  127c1377b054a3f65bf2754ebb24e7f2
Packit Service 21b5d1
Exif.Image.GPSTag                            Long        1  1300
Packit Service 21b5d1
Exif.GPSInfo.GPSVersionID                    Byte        4  2.2.0.0
Packit Service 21b5d1
Iptc.Application2.RecordVersion              Short       1  2
Packit Service 21b5d1
Iptc.Application2.ObjectName                 String     18  040621-N-6536T-062
Packit Service 21b5d1
Iptc.Application2.Urgency                    String      1  5
Packit Service 21b5d1
Iptc.Application2.Category                   String      1  N
Packit Service 21b5d1
Iptc.Application2.SuppCategory               String     12  703-614-9154
Packit Service 21b5d1
Iptc.Application2.SuppCategory               String     23  navyvisualnews@navy.mil
Packit Service 21b5d1
Iptc.Application2.SuppCategory               String     11  UNCLASSFIED
Packit Service 21b5d1
Iptc.Application2.Keywords                   String     13  ronald reagan
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      6  reagan
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      6  cvn 76
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      6  cvn-76
Packit Service 21b5d1
Iptc.Application2.Keywords                   String     18  straights magellan
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      8  magellan
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      7  carrier
Packit Service 21b5d1
Iptc.Application2.Keywords                   String     12  nimitz-class
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      4  ship
Packit Service 21b5d1
Iptc.Application2.Keywords                   String      8  underway
Packit Service 21b5d1
Iptc.Application2.SpecialInstructions        String     49  Credit as U.S. Navy photo by Elizabeth Thompson. 
Packit Service 21b5d1
Iptc.Application2.DateCreated                Date        8  2004-06-21
Packit Service 21b5d1
Iptc.Application2.TimeCreated                Time       11  00:00:00+00:00
Packit Service 21b5d1
Iptc.Application2.DigitizationDate           Date        8  2004-06-21
Packit Service 21b5d1
Iptc.Application2.DigitizationTime           Time       11  23:37:53-04:00
Packit Service 21b5d1
Iptc.Application2.Byline                     String     31  Photographerís Mate 3rd Class (
Packit Service 21b5d1
Iptc.Application2.BylineTitle                String     21  U.S Navy Photographer
Packit Service 21b5d1
Iptc.Application2.City                       String     19  Straits of Magellan
Packit Service 21b5d1
Iptc.Application2.CountryName                String     13  South America
Packit Service 21b5d1
Iptc.Application2.Credit                     String      8  U.S Navy
Packit Service 21b5d1
Iptc.Application2.Source                     String     24  Navy Visual News Service
Packit Service 21b5d1
Iptc.Application2.Caption                    String    400  040621-N-6536T-062
Packit Service 21b5d1
USS Ronald Reagan (CVN 76), June 21, 2004 -  USS Ronald Reagan (CVN 76) sails through the Straits of Magellan on its way to the Pacific Ocean. The Navyís newest aircraft carrier is underway circumnavigating South America in transit to its new homeport of San Diego. U.S. Navy photo by Photographerís Mate 3rd Class (AW) Elizabeth Thompson. (RELEASE)
Packit Service 21b5d1
                               
Packit Service 21b5d1
Iptc.Application2.Writer                     String      9  Dir. NVNS
Packit Service 21b5d1
Xmp.xmp.ModifyDate                           XmpText    25  2016-09-13T11:58:16+01:00
Packit Service 21b5d1
Xmp.xmp.CreateDate                           XmpText    25  2004-06-21T23:37:53+01:00
Packit Service 21b5d1
Xmp.xmp.MetadataDate                         XmpText    25  2016-09-13T11:58:16+01:00
Packit Service 21b5d1
Xmp.xmp.CreatorTool                          XmpText    38  Adobe Photoshop Elements 6.0 Macintosh
Packit Service 21b5d1
Xmp.photoshop.Instructions                   XmpText    49  Credit as U.S. Navy photo by Elizabeth Thompson. 
Packit Service 21b5d1
Xmp.photoshop.CaptionWriter                  XmpText     9  Dir. NVNS
Packit Service 21b5d1
Xmp.photoshop.Urgency                        XmpText     1  5
Packit Service 21b5d1
Xmp.photoshop.City                           XmpText    19  Straits of Magellan
Packit Service 21b5d1
Xmp.photoshop.Category                       XmpText     1  N
Packit Service 21b5d1
Xmp.photoshop.Country                        XmpText    13  South America
Packit Service 21b5d1
Xmp.photoshop.Credit                         XmpText     8  U.S Navy
Packit Service 21b5d1
Xmp.photoshop.AuthorsPosition                XmpText    21  U.S Navy Photographer
Packit Service 21b5d1
Xmp.photoshop.DateCreated                    XmpText    10  2004-06-21
Packit Service 21b5d1
Xmp.photoshop.Source                         XmpText    24  Navy Visual News Service
Packit Service 21b5d1
Xmp.photoshop.LegacyIPTCDigest               XmpText    32  977177A6C759A2BBD07317E3D5921073
Packit Service 21b5d1
Xmp.photoshop.ColorMode                      XmpText     1  3
Packit Service 21b5d1
Xmp.photoshop.ICCProfile                     XmpText    16  Adobe RGB (1998)
Packit Service 21b5d1
Xmp.photoshop.SupplementalCategories         XmpBag      3  703-614-9154, navyvisualnews@navy.mil, UNCLASSFIED
Packit Service 21b5d1
Xmp.xmpMM.InstanceID                         XmpText    40  xmp.iid:F77F117407206811822A8C00775B3FDC
Packit Service 21b5d1
Xmp.xmpMM.DocumentID                         XmpText    37  uuid:D6CBDC1D8DF2E511BA6BFBE914561F6D
Packit Service 21b5d1
Xmp.xmpMM.OriginalDocumentID                 XmpText    37  uuid:D6CBDC1D8DF2E511BA6BFBE914561F6D
Packit Service 21b5d1
Xmp.xmpMM.DerivedFrom                        XmpText     0  type="Struct"
Packit Service 21b5d1
Xmp.xmpMM.DerivedFrom/stRef:instanceID       XmpText    41  uuid:ec11a6b0-cc13-11d8-9c21-fa22e28297f6
Packit Service 21b5d1
Xmp.xmpMM.DerivedFrom/stRef:documentID       XmpText    58  adobe:docid:photoshop:1c90e091-c489-11d8-ad7d-b4c1b2598b09
Packit Service 21b5d1
Xmp.xmpMM.History                            XmpText     0  type="Seq"
Packit Service 21b5d1
Xmp.xmpMM.History[1]                         XmpText     0  type="Struct"
Packit Service 21b5d1
Xmp.xmpMM.History[1]/stEvt:action            XmpText     5  saved
Packit Service 21b5d1
Xmp.xmpMM.History[1]/stEvt:instanceID        XmpText    40  xmp.iid:F77F117407206811822A8C00775B3FDC
Packit Service 21b5d1
Xmp.xmpMM.History[1]/stEvt:when              XmpText    25  2016-09-13T11:58:16+01:00
Packit Service 21b5d1
Xmp.xmpMM.History[1]/stEvt:softwareAgent     XmpText    39  Adobe Photoshop Elements 12.0 Macintosh
Packit Service 21b5d1
Xmp.xmpMM.History[1]/stEvt:changed           XmpText     1  /
Packit Service 21b5d1
Xmp.dc.format                                XmpText    10  image/jpeg
Packit Service 21b5d1
Xmp.dc.description                           LangAlt     1  lang="x-default" 040621-N-6536T-062
Packit Service 21b5d1
USS Ronald Reagan (CVN 76), June 21, 2004 -  USS Ronald Reagan (CVN 76) sails through the Straits of Magellan on its way to the Pacific Ocean. The Navyís newest aircraft carrier is underway circumnavigating South America in transit to its new homeport of San Diego. U.S. Navy photo by Photographerís Mate 3rd Class (AW) Elizabeth Thompson. (RELEASE)
Packit Service 21b5d1
                               
Packit Service 21b5d1
Xmp.dc.title                                 LangAlt     1  lang="x-default" 040621-N-6536T-062
Packit Service 21b5d1
Xmp.dc.creator                               XmpSeq      1  Photographerís Mate 3rd Class (A
Packit Service 21b5d1
Xmp.dc.subject                               XmpBag     10  ronald reagan, reagan, cvn 76, cvn-76, straights magellan, magellan, carrier, nimitz-class, ship, underway
Packit Service 21b5d1
Xmp.xmpRights.Marked                         XmpText     5  False
Packit Service 21b5d1
"""
Packit Service 21b5d1
    ]
Packit Service 21b5d1
Packit Service 21b5d1
    def compare_stdout(self, i, command, got_stdout, expected_stdout):
Packit Service 21b5d1
        """
Packit Service 21b5d1
        The metadata in this file contain badly encoded strings with linefeeds
Packit Service 21b5d1
        only resulting in un-comparable strings. Here we check line by line
Packit Service 21b5d1
        instead, which removes the nasty line ending problems.
Packit Service 21b5d1
        """
Packit Service 21b5d1
        for i, (got_line, expected_line) in \
Packit Service 21b5d1
            enumerate(zip(got_stdout.splitlines(), expected_stdout.splitlines())):
Packit Service 21b5d1
            self.assertEqual(
Packit Service 21b5d1
                got_line, expected_line, msg="error in line {:d}".format(i)
Packit Service 21b5d1
            )
Packit Service 21b5d1
Packit Service 21b5d1
    stderr = [""]
Packit Service 21b5d1
    retval = [0]