From ebe72f4677e63b241cd269adc52db01f2a5423a3 Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Mon, 16 May 2022 10:00:27 +0100 Subject: [PATCH] Remove jpeg option Just no need really --- iiif/ops.py | 11 ++++------- tests/test_ops.py | 3 --- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/iiif/ops.py b/iiif/ops.py index 89d12f3..db07094 100644 --- a/iiif/ops.py +++ b/iiif/ops.py @@ -221,14 +221,11 @@ def parse_quality(quality: str) -> Quality: class Format(Enum): - jpg = ('jpg', 'jpeg') - png = ('png',) - - def matches(self, value: str) -> bool: - return value in self.value + jpg = 'jpg' + png = 'png' def __str__(self) -> str: - return self.value[0] + return self.value def parse_format(fmt: str) -> Format: @@ -242,7 +239,7 @@ def parse_format(fmt: str) -> Format: :return: a Format """ for option in Format: - if option.matches(fmt): + if fmt == option.value: return option raise InvalidIIIFParameter('Format', fmt) diff --git a/tests/test_ops.py b/tests/test_ops.py index cbe21a0..a23d199 100644 --- a/tests/test_ops.py +++ b/tests/test_ops.py @@ -209,9 +209,6 @@ class TestParseFormat: def test_level0(self): assert parse_format('jpg') == Format.jpg - def test_level0(self): - assert parse_format('jpeg') == Format.jpg - def test_level2_png(self): assert parse_format('png') == Format.png