[Test Suite] Test suite can't limit certain tests to certain file types

Bug #532194 reported by Stani
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Confirmed
High
Nadia Alramli

Bug Description

ATM we are only testing: jpeg, gif and png which is pretty weak. For example if SVG supports break, we don't get any notice. All file types that phatch supports should be in input
but we only need to do basic tests on them: just see if they can be opened. If would put these all now in the test suite would take a lot of time as it duplicates wor.

Right now we have this problem:
Test suite should not try to perform jpeg actions on other file types
This is spamming the test logs.

actionlist: /home/stani/Desktop/repo/lucid/tests/output/actionlists/delete_tags_Method=One.phatch
Error 0:Can not apply action Delete Tags on image 'bee.png' in folder:
/home/stani/Desktop/repo/lucid/tests/input

Format PNG does not support overwriting "Exif_Image_ImageDescription".

Action:{'fields': {'Method': u'One',
            'Tag': 'Exif_Image_ImageDescription',
            '__enabled__': 'yes'},
 'label': 'Delete Tags'}

Traceback (most recent call last):
  File "/home/stani/Desktop/repo/lucid/phatch/core/api.py", line 617, in apply_action_to_photo
    photo = action.apply(photo, read_only_settings, cache)
  File "/home/stani/Desktop/repo/lucid/phatch/actions/delete_tags.py", line 46, in apply
    del info[tag]
  File "/home/stani/Desktop/repo/lucid/phatch/core/pil.py", line 317, in __delitem__
    self.assert_writable(tag)
  File "/home/stani/Desktop/repo/lucid/phatch/core/pil.py", line 426, in assert_writable
    % {'format': self['format'], 'tag': tag})
NotWritableTagError: Format PNG does not support overwriting "Exif_Image_ImageDescription".

actionlist: /home/stani/Desktop/repo/lucid/tests/output/actionlists/lossless_jpeg_UpdateJPEG=1_UpdateOriTag=1_ShowAdvancedOps=1_Trafo=Automatic_UpdateExifThumb=0_Util=Exiftran.phatch
Error 0:Can not apply action Lossless JPEG on image 'bee.png' in folder:
/home/stani/Desktop/repo/lucid/tests/input

Lossless JPEG transformation does not work on a PNG image::
/home/stani/Desktop/repo/lucid/tests/input/bee.png

Action:{'fields': {'All': '30%',
            'Angle': u'180 degrees',
            'Angle ': u'270 degrees',
            'Bottom': '0px',
            'Copy': u'All',
            'Direction': u'Vertical',
            'Direction ': u'Vertical',
            'File Name': u'<filename>_lossless_jpeg_UpdateJPEG=1_UpdateOriTag=1_ShowAdvancedOps=1_Trafo=Automatic_UpdateExifThumb=0_Util=Exiftran',
            'In': u'/home/stani/Desktop/repo/lucid/tests/output/images',
            'Left': '0px',
            'Mode': u'Custom',
            'Preserve Timestamp': 'no',
            'Right': '0px',
            'Show Advanced Options': 'yes',
            'Top': '0px',
            'Transformation': u'Automatic (use exif orientation)',
            'Transformation ': u'Transverse',
            'Update Exif Thumbnail': 'no',
            'Update JPEG': 'yes',
            'Update Orientation Tag': 'yes',
            'Utility': u'Exiftran (with exif support)',
            '__enabled__': 'yes'},
 'label': 'Lossless JPEG'}

Traceback (most recent call last):
  File "/home/stani/Desktop/repo/lucid/phatch/core/api.py", line 617, in apply_action_to_photo
    photo = action.apply(photo, read_only_settings, cache)
  File "/home/stani/Desktop/repo/lucid/phatch/actions/lossless_jpeg.py", line 252, in apply
    self.call(photo, info, utility)
  File "/home/stani/Desktop/repo/lucid/phatch/actions/lossless_jpeg.py", line 273, in call
    % (LOSSLESS_JPEG_FORMAT_ERROR % format, info['path']))
Exception: Lossless JPEG transformation does not work on a PNG image::
/home/stani/Desktop/repo/lucid/tests/input/bee.png
*

Tags: test
Stani (stani)
description: updated
summary: - Test suite should not try to edit metadata of png or gif images
+ Test suite should not try to perform jpeg actions on other file types
description: updated
Stani (stani)
tags: added: test
Stani (stani)
summary: - Test suite should not try to perform jpeg actions on other file types
+ Test suite can't limit certain tests to certain file types
description: updated
Stani (stani)
summary: - Test suite can't limit certain tests to certain file types
+ [Test Suite] Test suite can't limit certain tests to certain file types
Stani (stani)
Changed in phatch:
importance: Low → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.