Skip to content

Commit 05d8ba1

Browse files
Merge pull request #837 from adamtheturtle/move-tests
Move a few tests around
2 parents f57a025 + 42894bd commit 05d8ba1

File tree

1 file changed

+25
-37
lines changed

1 file changed

+25
-37
lines changed

tests/test_add_target.py

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,37 +49,6 @@ def test_add_two_targets(
4949
client.add_target(name='x', width=1, image=high_quality_image)
5050
client.add_target(name='a', width=1, image=high_quality_image)
5151

52-
53-
class TestCustomBaseVWSURL:
54-
"""
55-
Tests for using a custom base VWS URL.
56-
"""
57-
58-
def test_custom_base_url(self, high_quality_image: io.BytesIO) -> None:
59-
"""
60-
It is possible to use add a target to a database under a custom VWS
61-
URL.
62-
"""
63-
base_vws_url = 'http://example.com'
64-
with MockVWS(base_vws_url=base_vws_url) as mock:
65-
client = VWS(
66-
server_access_key=mock.server_access_key,
67-
server_secret_key=mock.server_secret_key,
68-
base_vws_url=base_vws_url,
69-
)
70-
71-
client.add_target(
72-
name='x',
73-
width=1,
74-
image=high_quality_image,
75-
)
76-
77-
78-
class TestApplicationMetadata:
79-
"""
80-
Tests for the ``application_metadata`` parameter to ``add_target``.
81-
"""
82-
8352
@pytest.mark.parametrize('application_metadata', [None, b'a'])
8453
def test_valid_metadata(
8554
self,
@@ -97,12 +66,6 @@ def test_valid_metadata(
9766
application_metadata=application_metadata,
9867
)
9968

100-
101-
class TestActiveFlag:
102-
"""
103-
Tests for the ``active_flag`` parameter to ``add_target``.
104-
"""
105-
10669
@pytest.mark.parametrize('active_flag', [True, False])
10770
def test_active_flag_given(
10871
self,
@@ -121,3 +84,28 @@ def test_active_flag_given(
12184
)
12285
target_record = client.get_target_record(target_id=target_id)
12386
assert target_record['active_flag'] is active_flag
87+
88+
89+
class TestCustomBaseVWSURL:
90+
"""
91+
Tests for using a custom base VWS URL.
92+
"""
93+
94+
def test_custom_base_url(self, high_quality_image: io.BytesIO) -> None:
95+
"""
96+
It is possible to use add a target to a database under a custom VWS
97+
URL.
98+
"""
99+
base_vws_url = 'http://example.com'
100+
with MockVWS(base_vws_url=base_vws_url) as mock:
101+
client = VWS(
102+
server_access_key=mock.server_access_key,
103+
server_secret_key=mock.server_secret_key,
104+
base_vws_url=base_vws_url,
105+
)
106+
107+
client.add_target(
108+
name='x',
109+
width=1,
110+
image=high_quality_image,
111+
)

0 commit comments

Comments
 (0)