Skip to content

Commit ef5911f

Browse files
committed
A few docstrings
1 parent 8aa1f86 commit ef5911f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/test_query.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_no_matches(
2323
high_quality_image: io.BytesIO,
2424
) -> None:
2525
"""
26-
TODO docstring
26+
An empty list is returned if there are no matches.
2727
"""
2828
result = cloud_reco_client.query(image=high_quality_image)
2929
assert result == []
@@ -35,7 +35,7 @@ def test_match(
3535
high_quality_image: io.BytesIO,
3636
) -> None:
3737
"""
38-
XXX
38+
Details of matching targets are returned.
3939
"""
4040
target_id = vws_client.add_target(
4141
name='x',
@@ -59,7 +59,7 @@ def test_default(
5959
high_quality_image: io.BytesIO,
6060
) -> None:
6161
"""
62-
XXX
62+
By default the maximum number of results is 1.
6363
"""
6464
target_id = vws_client.add_target(
6565
name=uuid.uuid4().hex,
@@ -83,7 +83,7 @@ def test_custom(
8383
high_quality_image: io.BytesIO,
8484
) -> None:
8585
"""
86-
XXX
86+
It is possible to set a custom ``max_num_results``.
8787
"""
8888
target_id = vws_client.add_target(
8989
name=uuid.uuid4().hex,
@@ -114,6 +114,10 @@ def test_too_many(
114114
cloud_reco_client: CloudRecoService,
115115
high_quality_image: io.BytesIO,
116116
) -> None:
117+
"""
118+
A ``MaxNumResultsOutOfRange`` error is raised if the given
119+
``max_num_results`` is out of range.
120+
"""
117121
with pytest.raises(MaxNumResultsOutOfRange) as exc:
118122
cloud_reco_client.query(
119123
image=high_quality_image,
@@ -127,6 +131,9 @@ def test_too_many(
127131
assert str(exc.value) == expected_value
128132

129133
class TestBadCredentials:
134+
"""
135+
Tests for using bad credentials.
136+
"""
130137

131138
def test_bad_credentials(self, high_quality_image: io.BytesIO):
132139
cloud_reco_client = CloudRecoService(

0 commit comments

Comments
 (0)