Skip to content

Commit 41d3f7a

Browse files
Merge pull request #675 from adamtheturtle/remove-png-greyscale-fixture
Replace png_greyscale fixture with one more appropriately named
2 parents 8dff6eb + 9083cca commit 41d3f7a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/mock_vws/fixtures/images.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ def png_rgb() -> io.BytesIO:
3838

3939

4040
@pytest.fixture
41-
def png_greyscale() -> io.BytesIO:
41+
def image_file_failed_state() -> io.BytesIO:
4242
"""
43-
Return a 1x1 PNG file in the greyscale color space.
43+
Return an image file which is expected to be accepted by the add and
44+
update target endpoints, but get a "failed" status.
45+
46+
This returns only one image, unlike ``image_files_failed_state`` in the
47+
interest of fast tests.
4448
"""
49+
# This image gets a "failed" status because it is so small.
4550
return make_image_file(
4651
file_format='PNG',
47-
color_space='L',
52+
color_space='RGB',
4853
width=1,
4954
height=1,
5055
)

tests/mock_vws/test_get_duplicates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ def test_duplicates(
144144
def test_status(
145145
self,
146146
vuforia_database_keys: VuforiaDatabaseKeys,
147-
png_greyscale: io.BytesIO,
147+
image_file_failed_state: io.BytesIO,
148148
) -> None:
149149
"""
150150
Targets are not duplicates if the status is not 'success'.
151151
"""
152-
image_data = png_greyscale.read()
152+
image_data = image_file_failed_state.read()
153153
image_data_encoded = base64.b64encode(image_data).decode('ascii')
154154

155155
original_data = {

0 commit comments

Comments
 (0)