Skip to content

Commit bedaef0

Browse files
author
Ulrik Johansson
committed
Add basic test for AclResource
1 parent b602975 commit bedaef0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_admin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ def test_new_partitions():
2626
assert(good_partitions.new_assignments == [[1, 2, 3]])
2727

2828

29+
def test_acl_resource():
30+
good_resource = kafka.admin.AclResource("TOPIC", "ALL", "ALLOW", "foo",
31+
"User:bar", "*", "LITERAL")
32+
assert(good_resource.resource_type == kafka.admin.AclResourceType.TOPIC)
33+
assert(good_resource.operation == kafka.admin.AclOperation.ALL)
34+
assert(good_resource.permission_type == kafka.admin.AclPermissionType.ALLOW)
35+
assert(good_resource.pattern_type == kafka.admin.AclResourcePatternType.LITERAL)
36+
2937
def test_new_topic():
3038
with pytest.raises(IllegalArgumentError):
3139
bad_topic = kafka.admin.NewTopic('foo', -1, -1)

0 commit comments

Comments
 (0)