Skip to content

Commit

Permalink
dev(narugo): final check
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Sep 10, 2024
1 parent e618b22 commit bc73fe3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/sd/test_nai.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,26 @@ def test_save_image_with_naimeta_lsb_true(self, nai3_clear_file, nai3_meta_witho
save_image_with_naimeta(nai3_clear_file, f'image{ext}',
add_lsb_meta=True, metadata=nai3_meta_without_title)

@pytest.mark.parametrize(['ext', 'okay'], [
('.png', True),
('.webp', True),
('.jpg', True),
('.jpeg', True),
('.tiff', False),
('.gif', True),
])
def test_save_image_with_naimeta_metainfo_true(self, nai3_clear_file, nai3_meta_without_title,
ext, okay):
with isolated_directory():
if okay:
save_image_with_naimeta(nai3_clear_file, f'image{ext}',
save_metainfo=True, metadata=nai3_meta_without_title)
assert get_naimeta_from_image(f'image{ext}') == pytest.approx(nai3_meta_without_title)
else:
with pytest.raises(SystemError):
save_image_with_naimeta(nai3_clear_file, f'image{ext}',
save_metainfo=True, metadata=nai3_meta_without_title)

@pytest.mark.parametrize(['ext', 'warns', 'okay'], [
('.png', False, True),
('.webp', False, True),
Expand Down

0 comments on commit bc73fe3

Please sign in to comment.