Skip to content

Commit ea4a682

Browse files
committed
address review comments
1 parent c02f53e commit ea4a682

File tree

9 files changed

+27
-352
lines changed

9 files changed

+27
-352
lines changed

confluent_kafka/avro/cached_schema_registry_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def __init__(self, url, max_schemas_per_subject=1000, ca_location=None, cert_loc
7272
# In order to maintain compatibility the url(conf in future versions) param has been preserved for now.
7373
conf = url
7474
if not isinstance(url, dict):
75-
7675
conf = {
7776
'url': url,
7877
'ssl.ca.location': ca_location,
@@ -91,7 +90,10 @@ def __init__(self, url, max_schemas_per_subject=1000, ca_location=None, cert_loc
9190

9291
# Ensure URL valid scheme is included; http[s]
9392
url = conf.get('url', '')
94-
if not isinstance(url, string_types) or not url.startswith('http'):
93+
if not isinstance(url, string_types):
94+
raise TypeError("URL must be of type str")
95+
96+
if not url.startswith('http'):
9597
raise ValueError("Invalid URL provided for Schema Registry")
9698

9799
# subj => { schema => id }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ckp_tester:test_secret, Testers
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SchemaRegistry {
2+
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
3+
file="/conf/schema-registry/login.properties";
4+
};

docker/docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
zookeeper:
4-
image: confluentinc/cp-zookeeper
4+
image: confluentinc/cp-zookeeper:5.0.0
55
ports:
66
- 2181:2181
77
environment:
@@ -19,7 +19,7 @@ services:
1919
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
2020
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
2121
schema-registry:
22-
image: confluentinc/cp-schema-registry
22+
image: confluentinc/cp-schema-registry:5.0.0
2323
depends_on:
2424
- zookeeper
2525
- kafka
@@ -40,7 +40,7 @@ services:
4040
SCHEMA_REGISTRY_SSL_TRUSTSTORE_PASSWORD: abcdefgh
4141
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
4242
schema-registry-basic-auth:
43-
image: confluentinc/cp-schema-registry
43+
image: confluentinc/cp-schema-registry:5.0.0
4444
depends_on:
4545
- zookeeper
4646
- kafka

tests/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ Advanced users can reference the provided configuration file, [testconf.json](in
3939
Most developers however should use the defaults.
4040

4141
### Running tests
42-
To run the entire test suite:
42+
To run the entire test suite:
43+
44+
From the source root directory ...
4345

4446
- With tox installed (will run against all supported interpreters)
4547
1. Uncomment the following line from [tox.ini](../tox.ini)
@@ -48,16 +50,21 @@ To run the entire test suite:
4850
- ```./tests/run.sh tox [options]```
4951

5052
- Without tox (will run against current interpreter)
51-
- ```./tests/run.sh```
53+
- ```./tests/run.sh all```
54+
55+
56+
To run just the unit tests
57+
58+
./tests/run.sh unit
5259

53-
To run a specific `mode` or set of `modes` use the following syntax
60+
To run a specific integration test `mode` or set of `modes` use the following syntax
5461

5562
./tests/run.sh <test mode 1> <test mode 2>..
5663

5764
For example:
5865

5966
./tests/run.sh producer consumer
6067

61-
To get a list of `modes` simply supply the `help` option
68+
To get a list of integration test `modes` simply supply the `help` option
6269

6370
./tests/run.sh help

tests/avro/test_cached_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ def test_empty_url(self):
164164
})
165165

166166
def test_invalid_type_url(self):
167-
with self.assertRaises(ValueError):
167+
with self.assertRaises(TypeError):
168168
self.client = CachedSchemaRegistryClient(
169169
url=1)
170170

171171
def test_invalid_type_url_dict(self):
172-
with self.assertRaises(ValueError):
172+
with self.assertRaises(TypeError):
173173
self.client = CachedSchemaRegistryClient({
174174
"url": 1
175175
})

0 commit comments

Comments
 (0)