forked from confluentinc/confluent-kafka-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_enums.py
25 lines (18 loc) · 854 Bytes
/
test_enums.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
import confluent_kafka
def test_enums():
""" Make sure librdkafka error enums are reachable directly from the
KafkaError class without an instantiated object. """
print(confluent_kafka.KafkaError._NO_OFFSET)
print(confluent_kafka.KafkaError.REBALANCE_IN_PROGRESS)
def test_tstype_enums():
""" Make sure librdkafka tstype enums are available. """
assert confluent_kafka.TIMESTAMP_NOT_AVAILABLE == 0
assert confluent_kafka.TIMESTAMP_CREATE_TIME == 1
assert confluent_kafka.TIMESTAMP_LOG_APPEND_TIME == 2
def test_offset_consts():
""" Make sure librdkafka's logical offsets are available. """
assert confluent_kafka.OFFSET_BEGINNING == -2
assert confluent_kafka.OFFSET_END == -1
assert confluent_kafka.OFFSET_STORED == -1000
assert confluent_kafka.OFFSET_INVALID == -1001