File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 44
55import io
66
7+ from mock_vws import MockVWS
8+
79from 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+ )
You can’t perform that action at this time.
0 commit comments