From bedaef0ff7869e79b890a83bf2ce75b939e08aea Mon Sep 17 00:00:00 2001 From: Ulrik Johansson Date: Sat, 17 Nov 2018 01:15:23 +0100 Subject: [PATCH] Add basic test for AclResource --- test/test_admin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_admin.py b/test/test_admin.py index fd9c54ddd..65febb18b 100644 --- a/test/test_admin.py +++ b/test/test_admin.py @@ -26,6 +26,14 @@ def test_new_partitions(): assert(good_partitions.new_assignments == [[1, 2, 3]]) +def test_acl_resource(): + good_resource = kafka.admin.AclResource("TOPIC", "ALL", "ALLOW", "foo", + "User:bar", "*", "LITERAL") + assert(good_resource.resource_type == kafka.admin.AclResourceType.TOPIC) + assert(good_resource.operation == kafka.admin.AclOperation.ALL) + assert(good_resource.permission_type == kafka.admin.AclPermissionType.ALLOW) + assert(good_resource.pattern_type == kafka.admin.AclResourcePatternType.LITERAL) + def test_new_topic(): with pytest.raises(IllegalArgumentError): bad_topic = kafka.admin.NewTopic('foo', -1, -1)