Skip to content

Commit 51b0efa

Browse files
committed
Parametrize metadata test
1 parent e9e0c01 commit 51b0efa

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

tests/test_add_target.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,21 @@ class TestApplicationMetadata:
7979
Tests for the ``application_metadata`` parameter to ``add_target``.
8080
"""
8181

82-
def test_none(self, client: VWS, high_quality_image: io.BytesIO) -> None:
83-
"""
84-
No exception is raised when ``None`` is given.
85-
"""
86-
client.add_target(
87-
name='x',
88-
width=1,
89-
image=high_quality_image,
90-
application_metadata=None,
91-
)
92-
93-
def test_given(
82+
@pytest.mark.parametrize('application_metadata', [None, b'a'])
83+
def test_valid_metadata(
9484
self,
9585
client: VWS,
9686
high_quality_image: io.BytesIO,
87+
application_metadata: Optional[bytes],
9788
) -> None:
9889
"""
99-
No exception is raised when bytes are given.
90+
No exception is raised when ``None`` or bytes is given.
10091
"""
10192
client.add_target(
10293
name='x',
10394
width=1,
10495
image=high_quality_image,
105-
application_metadata=b'a',
96+
application_metadata=None,
10697
)
10798

10899

@@ -112,7 +103,7 @@ class TestActiveFlag:
112103
"""
113104

114105
@pytest.mark.parametrize('active_flag', [True, False])
115-
def test_given(
106+
def test_active_flag_given(
116107
self,
117108
client: VWS,
118109
high_quality_image: io.BytesIO,

0 commit comments

Comments
 (0)