Skip to content

Commit 6c578b6

Browse files
committed
Add test for custom base URL
1 parent c460540 commit 6c578b6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/test_add_target.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import io
66

7+
from mock_vws import MockVWS
8+
79
from vws import VWS
810

911

@@ -32,3 +34,28 @@ def test_add_two_targets(
3234
"""
3335
client.add_target(name='x', width=1, image=high_quality_image)
3436
client.add_target(name='a', width=1, image=high_quality_image)
37+
38+
39+
class TestCustomBaseURL:
40+
"""
41+
Tests for adding images to databases under custom VWS URLs.
42+
"""
43+
44+
def test_custom_base_url(self, high_quality_image: io.BytesIO) -> None:
45+
"""
46+
It is possible to use add a target to a database under a custom VWS
47+
URL.
48+
"""
49+
base_vws_url = 'http://example.com'
50+
with MockVWS(base_vws_url=base_vws_url) as mock:
51+
client = VWS(
52+
server_access_key=mock.server_access_key,
53+
server_secret_key=mock.server_secret_key,
54+
base_vws_url=base_vws_url,
55+
)
56+
57+
client.add_target(
58+
name='x',
59+
width=1,
60+
image=high_quality_image,
61+
)

0 commit comments

Comments
 (0)