|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 |
|
| 3 | +import sys |
3 | 4 | from system_tests import CaseMeta, CopyFiles, CopyTmpFiles, DeleteFiles, path |
4 | 5 |
|
5 | 6 | ########################################################### |
@@ -73,7 +74,11 @@ class Rename_ExifTags(metaclass=CaseMeta): |
73 | 74 | ########################################################### |
74 | 75 |
|
75 | 76 | infile ="_DSC8437.exv" |
76 | | -outfile = "_DSC8437_a_b_c_d_e_f_g_h_i.exv" |
| 77 | +if sys.platform == 'win32': |
| 78 | + outfile = "_DSC8437_a_b_c_d_e_f_g_h_i.exv" |
| 79 | +else: |
| 80 | + outfile = "_DSC8437_a\\b_c_d*e?f<g>h|i.exv" |
| 81 | + |
77 | 82 | renformat = ":basename:_:Exif.Image.ImageDescription:" |
78 | 83 |
|
79 | 84 | @CopyTmpFiles("$data_path/" + infile) |
@@ -152,6 +157,28 @@ class Rename_TagNotIncluded(metaclass=CaseMeta): |
152 | 157 | """] |
153 | 158 | retval = [0] * len(commands) |
154 | 159 |
|
| 160 | +########################################################### |
| 161 | +# rename error: invalid tag name |
| 162 | +########################################################### |
| 163 | + |
| 164 | +infile ="_DSC8437.exv" |
| 165 | +renformat = ":basename:_:Exif.Image.ImageDescript:" |
| 166 | + |
| 167 | +@CopyTmpFiles("$data_path/" + infile) |
| 168 | +class Rename_InvalidTagName(metaclass=CaseMeta): |
| 169 | + infilename = path("$tmp_path/" + infile) |
| 170 | + commands = [ |
| 171 | + "$exiv2 --verbose --rename " + renformat + " " + infilename |
| 172 | + ] |
| 173 | + stdout = [ |
| 174 | + """File 1/1: $infilename |
| 175 | +""" |
| 176 | + ] |
| 177 | + stderr = ["""Exiv2 exception in rename action for file $infilename: |
| 178 | +Invalid tag name or ifdId `ImageDescript', ifdId 1 |
| 179 | +"""] |
| 180 | + retval = [1] * len(commands) |
| 181 | + |
155 | 182 | ########################################################### |
156 | 183 | # rename error: file contains no Exif data |
157 | 184 | ########################################################### |
|
0 commit comments