Skip to content

Commit

Permalink
Handle Linux tests when the filesystem doesn't support extended attri…
Browse files Browse the repository at this point in the history
…butes
  • Loading branch information
stefmolin committed Jun 8, 2024
1 parent d58d2e5 commit c39f755
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ def image_with_exif_data(tmp_path):
def image_with_metadata(image_with_exif_data):
"""Fixture for an image with metadata."""
if RUNNING_ON in ['Darwin', 'Linux']:
xattr(image_with_exif_data).set(
f'{getuser()}.test_extended_attribute'
if RUNNING_ON == 'Linux'
else 'com.apple.macl',
b'\x00',
)
try:
xattr(image_with_exif_data).set(
f'{getuser()}.test_extended_attribute'
if RUNNING_ON == 'Linux'
else 'com.apple.macl',
b'\x00',
)
except OSError: # pragma: nocover
# filesystem does not support extended attributes
pass
return image_with_exif_data


Expand Down

0 comments on commit c39f755

Please sign in to comment.