Blame tests/bugfixes/redmine/test_issue_1054.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 Exiv2jsonRecursiveJsonTreeWithXMP(metaclass=system_tests.CaseMeta):
Packit Service 21b5d1
Packit Service 21b5d1
    url = "http://dev.exiv2.org/issues/1054"
Packit Service 21b5d1
Packit Service 21b5d1
    env = {
Packit Service 21b5d1
        'TZ': 'UTC'
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    filename1 = system_tests.path("$data_path/BlueSquare.xmp")
Packit Service 21b5d1
    filename2 = system_tests.path("$data_path/exiv2-bug784.jpg")
Packit Service 21b5d1
Packit Service 21b5d1
    commands = [ "$exiv2json $filename1",
Packit Service 21b5d1
                 "$exiv2json x $filename1",
Packit Service 21b5d1
                 "$exiv2json $filename2",
Packit Service 21b5d1
               ]
Packit Service 21b5d1
Packit Service 21b5d1
    stdout = [ """{
Packit Service 21b5d1
	"Exif": {
Packit Service 21b5d1
		"Image": {
Packit Service 21b5d1
			"ImageWidth": 360,
Packit Service 21b5d1
			"ImageLength": 216,
Packit Service 21b5d1
			"Orientation": 1,
Packit Service 21b5d1
			"XResolution": [
Packit Service 21b5d1
				720000,
Packit Service 21b5d1
				10000
Packit Service 21b5d1
			],
Packit Service 21b5d1
			"YResolution": [
Packit Service 21b5d1
				720000,
Packit Service 21b5d1
				10000
Packit Service 21b5d1
			],
Packit Service 21b5d1
			"ResolutionUnit": 2,
Packit Service 21b5d1
			"DateTime": "2005:09:07 22:09:51",
Packit Service 21b5d1
			"ImageDescription": "XMPFiles BlueSquare test file, created in Photoshop CS2, saved as .psd, .jpg, and .tif.",
Packit Service 21b5d1
			"Make": "Nikon"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"Photo": {
Packit Service 21b5d1
			"ColorSpace": 1,
Packit Service 21b5d1
			"PixelXDimension": 360,
Packit Service 21b5d1
			"PixelYDimension": 216,
Packit Service 21b5d1
			"DateTimeDigitized": "2005:09:07 22:07:40"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	},
Packit Service 21b5d1
	"Iptc": {
Packit Service 21b5d1
		"Application2": {
Packit Service 21b5d1
			"ObjectName": "Blue Square Test File - .jpg",
Packit Service 21b5d1
			"Keywords": "XMP",
Packit Service 21b5d1
			"Keywords": "Blue Square",
Packit Service 21b5d1
			"Keywords": "test file",
Packit Service 21b5d1
			"Keywords": "Photoshop",
Packit Service 21b5d1
			"Keywords": ".jpg",
Packit Service 21b5d1
			"DigitizationDate": "2005-09-07",
Packit Service 21b5d1
			"Caption": "XMPFiles BlueSquare test file, created in Photoshop CS2, saved as .psd, .jpg, and .tif."
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"Envelope": {
Packit Service 21b5d1
			"CharacterSet": "?%G"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	},
Packit Service 21b5d1
	"Xmp": {
Packit Service 21b5d1
		"dc": {
Packit Service 21b5d1
			"format": "image\/jpeg",
Packit Service 21b5d1
			"title": {
Packit Service 21b5d1
				"lang": {
Packit Service 21b5d1
					"x-default": "Blue Square Test File - .jpg",
Packit Service 21b5d1
					"en-US": "Blue Square Test File - .jpg",
Packit Service 21b5d1
					"de-CH": "Blaues Quadrat Test Datei - .jpg"
Packit Service 21b5d1
				}
Packit Service 21b5d1
			},
Packit Service 21b5d1
			"description": {
Packit Service 21b5d1
				"lang": {
Packit Service 21b5d1
					"x-default": "XMPFiles BlueSquare test file, created in Photoshop CS2, saved as .psd, .jpg, and .tif."
Packit Service 21b5d1
				}
Packit Service 21b5d1
			},
Packit Service 21b5d1
			"subject": "XMP, Blue Square, test file, Photoshop, .jpg"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmp": {
Packit Service 21b5d1
			"CreatorTool": "Adobe Photoshop CS2 Macintosh",
Packit Service 21b5d1
			"CreateDate": "2005-09-07T15:07:40-07:00",
Packit Service 21b5d1
			"ModifyDate": "2005-09-07T15:09:51-07:00",
Packit Service 21b5d1
			"MetadataDate": "2006-04-10T13:37:10-07:00"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmpMM": {
Packit Service 21b5d1
			"DocumentID": "uuid:9A3B7F52214211DAB6308A7391270C13",
Packit Service 21b5d1
			"InstanceID": "uuid:B59AC1B3214311DAB6308A7391270C13",
Packit Service 21b5d1
			"DerivedFrom": {
Packit Service 21b5d1
				"stRef": {
Packit Service 21b5d1
					"instanceID": "uuid:9A3B7F4F214211DAB6308A7391270C13",
Packit Service 21b5d1
					"documentID": "uuid:9A3B7F4E214211DAB6308A7391270C13"
Packit Service 21b5d1
				}
Packit Service 21b5d1
			}
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"photoshop": {
Packit Service 21b5d1
			"ColorMode": "3",
Packit Service 21b5d1
			"ICCProfile": "sRGB IEC61966-2.1"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"tiff": {
Packit Service 21b5d1
			"Orientation": "1",
Packit Service 21b5d1
			"XResolution": "720000\/10000",
Packit Service 21b5d1
			"YResolution": "720000\/10000",
Packit Service 21b5d1
			"ResolutionUnit": "2",
Packit Service 21b5d1
			"ImageWidth": "360",
Packit Service 21b5d1
			"ImageLength": "216",
Packit Service 21b5d1
			"NativeDigest": "256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;D0485928256FC8D17D036C26919E106D",
Packit Service 21b5d1
			"Make": "Nikon",
Packit Service 21b5d1
			"BitsPerSample": "8, 8, 8"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"exif": {
Packit Service 21b5d1
			"PixelXDimension": "360",
Packit Service 21b5d1
			"PixelYDimension": "216",
Packit Service 21b5d1
			"ColorSpace": "1",
Packit Service 21b5d1
			"NativeDigest": "36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;76DBD9F0A5E7ED8F62B4CE8EFA6478B4"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmlns": {
Packit Service 21b5d1
			"DerivedFrom": "",
Packit Service 21b5d1
			"dc": "http:\/\/purl.org\/dc\/elements\/1.1\/",
Packit Service 21b5d1
			"exif": "http:\/\/ns.adobe.com\/exif\/1.0\/",
Packit Service 21b5d1
			"photoshop": "http:\/\/ns.adobe.com\/photoshop\/1.0\/",
Packit Service 21b5d1
			"tiff": "http:\/\/ns.adobe.com\/tiff\/1.0\/",
Packit Service 21b5d1
			"xmp": "http:\/\/ns.adobe.com\/xap\/1.0\/",
Packit Service 21b5d1
			"xmpMM": "http:\/\/ns.adobe.com\/xap\/1.0\/mm\/"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	}
Packit Service 21b5d1
}
Packit Service 21b5d1
""",
Packit Service 21b5d1
    """{
Packit Service 21b5d1
	"Xmp": {
Packit Service 21b5d1
		"dc": {
Packit Service 21b5d1
			"format": "image\/jpeg",
Packit Service 21b5d1
			"title": {
Packit Service 21b5d1
				"lang": {
Packit Service 21b5d1
					"x-default": "Blue Square Test File - .jpg",
Packit Service 21b5d1
					"en-US": "Blue Square Test File - .jpg",
Packit Service 21b5d1
					"de-CH": "Blaues Quadrat Test Datei - .jpg"
Packit Service 21b5d1
				}
Packit Service 21b5d1
			},
Packit Service 21b5d1
			"description": {
Packit Service 21b5d1
				"lang": {
Packit Service 21b5d1
					"x-default": "XMPFiles BlueSquare test file, created in Photoshop CS2, saved as .psd, .jpg, and .tif."
Packit Service 21b5d1
				}
Packit Service 21b5d1
			},
Packit Service 21b5d1
			"subject": "XMP, Blue Square, test file, Photoshop, .jpg"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmp": {
Packit Service 21b5d1
			"CreatorTool": "Adobe Photoshop CS2 Macintosh",
Packit Service 21b5d1
			"CreateDate": "2005-09-07T15:07:40-07:00",
Packit Service 21b5d1
			"ModifyDate": "2005-09-07T15:09:51-07:00",
Packit Service 21b5d1
			"MetadataDate": "2006-04-10T13:37:10-07:00"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmpMM": {
Packit Service 21b5d1
			"DocumentID": "uuid:9A3B7F52214211DAB6308A7391270C13",
Packit Service 21b5d1
			"InstanceID": "uuid:B59AC1B3214311DAB6308A7391270C13",
Packit Service 21b5d1
			"DerivedFrom": {
Packit Service 21b5d1
				"stRef": {
Packit Service 21b5d1
					"instanceID": "uuid:9A3B7F4F214211DAB6308A7391270C13",
Packit Service 21b5d1
					"documentID": "uuid:9A3B7F4E214211DAB6308A7391270C13"
Packit Service 21b5d1
				}
Packit Service 21b5d1
			}
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"photoshop": {
Packit Service 21b5d1
			"ColorMode": "3",
Packit Service 21b5d1
			"ICCProfile": "sRGB IEC61966-2.1"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"tiff": {
Packit Service 21b5d1
			"Orientation": "1",
Packit Service 21b5d1
			"XResolution": "720000\/10000",
Packit Service 21b5d1
			"YResolution": "720000\/10000",
Packit Service 21b5d1
			"ResolutionUnit": "2",
Packit Service 21b5d1
			"ImageWidth": "360",
Packit Service 21b5d1
			"ImageLength": "216",
Packit Service 21b5d1
			"NativeDigest": "256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;D0485928256FC8D17D036C26919E106D",
Packit Service 21b5d1
			"Make": "Nikon",
Packit Service 21b5d1
			"BitsPerSample": "8, 8, 8"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"exif": {
Packit Service 21b5d1
			"PixelXDimension": "360",
Packit Service 21b5d1
			"PixelYDimension": "216",
Packit Service 21b5d1
			"ColorSpace": "1",
Packit Service 21b5d1
			"NativeDigest": "36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;76DBD9F0A5E7ED8F62B4CE8EFA6478B4"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmlns": {
Packit Service 21b5d1
			"DerivedFrom": "",
Packit Service 21b5d1
			"dc": "http:\/\/purl.org\/dc\/elements\/1.1\/",
Packit Service 21b5d1
			"exif": "http:\/\/ns.adobe.com\/exif\/1.0\/",
Packit Service 21b5d1
			"photoshop": "http:\/\/ns.adobe.com\/photoshop\/1.0\/",
Packit Service 21b5d1
			"tiff": "http:\/\/ns.adobe.com\/tiff\/1.0\/",
Packit Service 21b5d1
			"xmp": "http:\/\/ns.adobe.com\/xap\/1.0\/",
Packit Service 21b5d1
			"xmpMM": "http:\/\/ns.adobe.com\/xap\/1.0\/mm\/"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	}
Packit Service 21b5d1
}
Packit Service 21b5d1
""",
Packit Service 21b5d1
    """{
Packit Service 21b5d1
	"Exif": {
Packit Service 21b5d1
		"Image": {
Packit Service 21b5d1
			"Orientation": 1,
Packit Service 21b5d1
			"XResolution": [
Packit Service 21b5d1
				72,
Packit Service 21b5d1
				1
Packit Service 21b5d1
			],
Packit Service 21b5d1
			"YResolution": [
Packit Service 21b5d1
				72,
Packit Service 21b5d1
				1
Packit Service 21b5d1
			],
Packit Service 21b5d1
			"ResolutionUnit": 2,
Packit Service 21b5d1
			"YCbCrPositioning": 1,
Packit Service 21b5d1
			"Copyright": "Public Domain. Do whatever you like with this image",
Packit Service 21b5d1
			"ExifTag": 232
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"Photo": {
Packit Service 21b5d1
			"ExifVersion": "48 50 50 49"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	},
Packit Service 21b5d1
	"Iptc": {
Packit Service 21b5d1
		"Envelope": {
Packit Service 21b5d1
			"CharacterSet": "?%G"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"Application2": {
Packit Service 21b5d1
			"RecordVersion": 4,
Packit Service 21b5d1
			"Keywords": "1st",
Packit Service 21b5d1
			"Keywords": "2nd",
Packit Service 21b5d1
			"Keywords": "next1",
Packit Service 21b5d1
			"Keywords": "next2",
Packit Service 21b5d1
			"Keywords": "root",
Packit Service 21b5d1
			"Keywords": "root0",
Packit Service 21b5d1
			"Copyright": "Public Domain. Do whatever you like with this image"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	},
Packit Service 21b5d1
	"Xmp": {
Packit Service 21b5d1
		"dc": {
Packit Service 21b5d1
			"format": "image\/jpeg",
Packit Service 21b5d1
			"rights": {
Packit Service 21b5d1
				"lang": {
Packit Service 21b5d1
					"x-default": "Public Domain. Do whatever you like with this image"
Packit Service 21b5d1
				}
Packit Service 21b5d1
			},
Packit Service 21b5d1
			"subject": "1st, 2nd, next1, next2, root, root0"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmpMM": {
Packit Service 21b5d1
			"DocumentID": "004D48F936062EF5085A81BF96D4C494",
Packit Service 21b5d1
			"OriginalDocumentID": "004D48F936062EF5085A81BF96D4C494",
Packit Service 21b5d1
			"InstanceID": "xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853",
Packit Service 21b5d1
			"History": [
Packit Service 21b5d1
				{
Packit Service 21b5d1
					"stEvt": {
Packit Service 21b5d1
						"action": "saved",
Packit Service 21b5d1
						"instanceID": "xmp.iid:f74f0d02-e921-134e-8107-1dda17aad853",
Packit Service 21b5d1
						"when": "2015-03-24T20:35:55-05:00",
Packit Service 21b5d1
						"softwareAgent": "Adobe Photoshop Lightroom 4.4 (Windows)",
Packit Service 21b5d1
						"changed": "\/metadata"
Packit Service 21b5d1
					}
Packit Service 21b5d1
				}
Packit Service 21b5d1
			]
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmp": {
Packit Service 21b5d1
			"MetadataDate": "2015-03-24T20:35:55-05:00"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"crs": {
Packit Service 21b5d1
			"RawFileName": "exiv2.lr.jpg"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"lr": {
Packit Service 21b5d1
			"hierarchicalSubject": "root0|next1|next2, root|1st|2nd"
Packit Service 21b5d1
		},
Packit Service 21b5d1
		"xmlns": {
Packit Service 21b5d1
			"crs": "http:\/\/ns.adobe.com\/camera-raw-settings\/1.0\/",
Packit Service 21b5d1
			"dc": "http:\/\/purl.org\/dc\/elements\/1.1\/",
Packit Service 21b5d1
			"lr": "http:\/\/ns.adobe.com\/lightroom\/1.0\/",
Packit Service 21b5d1
			"stEvt": "http:\/\/ns.adobe.com\/xap\/1.0\/sType\/ResourceEvent#",
Packit Service 21b5d1
			"xmp": "http:\/\/ns.adobe.com\/xap\/1.0\/",
Packit Service 21b5d1
			"xmpMM": "http:\/\/ns.adobe.com\/xap\/1.0\/mm\/"
Packit Service 21b5d1
		}
Packit Service 21b5d1
	}
Packit Service 21b5d1
}
Packit Service 21b5d1
"""
Packit Service 21b5d1
    ]
Packit Service 21b5d1
    stderr = [""] * len(commands)
Packit Service 21b5d1
    retval = [0] * len(commands)