@@ -32,7 +32,9 @@ class TestCacheSchemaRegistryClient(unittest.TestCase):
32
32
def setUp (self ):
33
33
self .server = mock_registry .ServerThread (0 )
34
34
self .server .start ()
35
- self .client = CachedSchemaRegistryClient ('http://127.0.0.1:' + str (self .server .server .server_port ))
35
+ self .client = CachedSchemaRegistryClient ({
36
+ 'url' : 'http://127.0.0.1:' + str (self .server .server .server_port ),
37
+ })
36
38
37
39
def tearDown (self ):
38
40
self .server .shutdown ()
@@ -140,19 +142,25 @@ def hash_func(self):
140
142
141
143
def test_cert_no_key (self ):
142
144
with self .assertRaises (ValueError ):
143
- self .client = CachedSchemaRegistryClient (url = 'https://127.0.0.1:65534' ,
144
- cert_location = '/path/to/cert' )
145
+ self .client = CachedSchemaRegistryClient ({
146
+ 'url' : 'https://127.0.0.1:65534' ,
147
+ 'ssl.certificate.location' : '/path/to/cert' ,
148
+ })
145
149
146
150
def test_cert_with_key (self ):
147
- self .client = CachedSchemaRegistryClient (url = 'https://127.0.0.1:65534' ,
148
- cert_location = '/path/to/cert' ,
149
- key_location = '/path/to/key' )
151
+ self .client = CachedSchemaRegistryClient ({
152
+ 'url' : 'https://127.0.0.1:65534' ,
153
+ 'ssl.certificate.location' : '/path/to/cert' ,
154
+ 'ssl.key.location' : '/path/to/key'
155
+ })
150
156
self .assertTupleEqual (('/path/to/cert' , '/path/to/key' ), self .client ._session .cert )
151
157
152
- def test_cert_path (self ):
153
- self .client = CachedSchemaRegistryClient (url = 'https://127.0.0.1:65534' ,
154
- ca_location = '/path/to/ca' )
155
- self .assertEqual ('/path/to/ca' , self .client ._session .verify )
158
+ def test_key_no_cert (self ):
159
+ with self .assertRaises (ValueError ):
160
+ self .client = CachedSchemaRegistryClient ({
161
+ 'url' : 'https://127.0.0.1:65534' ,
162
+ 'ssl.key.location' : '/path/to/key'
163
+ })
156
164
157
165
def test_context (self ):
158
166
with self .client as c :
@@ -177,8 +185,9 @@ def test_empty_url(self):
177
185
178
186
def test_invalid_type_url (self ):
179
187
with self .assertRaises (TypeError ):
180
- self .client = CachedSchemaRegistryClient (
181
- url = 1 )
188
+ self .client = CachedSchemaRegistryClient ({
189
+ 'url' : 1
190
+ })
182
191
183
192
def test_invalid_type_url_dict (self ):
184
193
with self .assertRaises (TypeError ):
0 commit comments