Skip to content

Commit eb34f3b

Browse files
committed
Fix some lint issues
1 parent 8cf065c commit eb34f3b

3 files changed

Lines changed: 11 additions & 21 deletions

File tree

tests/test_add_target.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
import io
66

77
import pytest
8-
from mock_vws import MockVWS, States
9-
from requests import codes
8+
from mock_vws import MockVWS
109

1110
from vws import VWS
12-
from vws.exceptions import MetadataTooLarge, ProjectInactive
1311

1412

1513
class TestSuccess:
@@ -81,32 +79,24 @@ class TestApplicationMetadata:
8179
Tests for the ``application_metadata`` parameter to ``add_target``.
8280
"""
8381

84-
def test_none(self, client: VWS, high_quality_image: io.BytesIO) -> None:
85-
"""
86-
No exception is raised when ``None`` is given.
87-
"""
88-
client.add_target(
89-
name='x',
90-
width=1,
91-
image=high_quality_image,
92-
application_metadata=None,
93-
)
94-
95-
def test_given(
82+
@pytest.mark.parametrize('application_metadata', [None, b'a'])
83+
def test_valid(
9684
self,
9785
client: VWS,
9886
high_quality_image: io.BytesIO,
87+
application_metadata: Optional[bytes],
9988
) -> None:
10089
"""
101-
No exception is raised when bytes are given.
90+
No exception is raised when ``None`` or bytes is given.
10291
"""
10392
client.add_target(
10493
name='x',
10594
width=1,
10695
image=high_quality_image,
107-
application_metadata=b'a',
96+
application_metadata=None,
10897
)
10998

99+
110100
class TestActiveFlag:
111101
"""
112102
Tests for the ``active_flag`` parameter to ``add_target``.

tests/test_delete_target.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
import io
66

77
import pytest
8-
from requests import codes
98

109
from vws import VWS
11-
from vws.exceptions import TargetStatusProcessing, UnknownTarget
10+
from vws.exceptions import UnknownTarget
1211

1312

1413
class TestDelete:

tests/test_exceptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
BadImage,
1616
Fail,
1717
ImageTooLarge,
18-
TargetNameExist,
19-
TargetStatusProcessing,
2018
MetadataTooLarge,
2119
ProjectInactive,
20+
TargetNameExist,
21+
TargetStatusProcessing,
2222
UnknownTarget,
2323
)
2424

@@ -137,6 +137,7 @@ def test_target_name_exist(
137137

138138
assert exc.value.response.status_code == codes.FORBIDDEN
139139

140+
140141
def test_project_inactive(client: VWS, high_quality_image: io.BytesIO) -> None:
141142
"""
142143
A ``ProjectInactive`` exception is raised if adding a target to an

0 commit comments

Comments
 (0)