summaryrefslogtreecommitdiffstats
path: root/dmaap/tests/test_dmaapcontrollerif.py
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2021-04-29 14:06:09 +0100
committerefiacor <fiachra.corcoran@est.tech>2021-05-21 15:10:39 +0100
commit94d5e62176cb6a3d70e651bd51f0ab4029cd6cf2 (patch)
treec705479ef5c13a9e4d6d7f93deac1c98b83d6894 /dmaap/tests/test_dmaapcontrollerif.py
parent495e8f8283bd6dfb7b4d4f822b06291a7cf04205 (diff)
[DMAAP-PLUGIN] Fix incorrect var name in DMaaP plugin topic creation
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I5a17503b55380cd568f76a51656268592b778a26 Issue-ID: DCAEGEN2-2750
Diffstat (limited to 'dmaap/tests/test_dmaapcontrollerif.py')
-rw-r--r--dmaap/tests/test_dmaapcontrollerif.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/dmaap/tests/test_dmaapcontrollerif.py b/dmaap/tests/test_dmaapcontrollerif.py
index 25ddb88..07f2beb 100644
--- a/dmaap/tests/test_dmaapcontrollerif.py
+++ b/dmaap/tests/test_dmaapcontrollerif.py
@@ -3,6 +3,7 @@
# ================================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2020 Pantheon.tech. All rights reserved.
+# Modifications Copyright (c) 2021 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -76,30 +77,18 @@ def test_dmaapc (monkeypatch, mockconsul, mockdmaapbc):
topic_name = random_string(12)
# Make sure there's a topic description
- if "topic_description" in ctx.node.properties:
- topic_description = ctx.node.properties["topic_description"]
- else:
- topic_description = "No description provided"
+ topic_description = ctx.node.properties.get("topic_description", "No description provided")
# ..and the truly optional setting
- if "txenable" in ctx.node.properties:
- txenable = ctx.node.properties["txenable"]
- else:
- txenable= False
+ tnx_enabled = ctx.node.properties.get("tnxEnabled", False)
- if "replication_case" in ctx.node.properties:
- replication_case = ctx.node.properties["replication_case"]
- else:
- replication_case = None
+ replication_case = ctx.node.properties.get("replication_case")
- if "global_mr_url" in ctx.node.properties:
- global_mr_url = ctx.node.properties["global_mr_url"]
- else:
- global_mr_url = None
+ global_mr_url = ctx.node.properties.get("global_mr_url")
dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
ctx.logger.info("Attempting to create topic name {0}".format(topic_name))
- t = dmc.create_topic(topic_name, topic_description, txenable, DMAAP_OWNER, replication_case, global_mr_url)
+ t = dmc.create_topic(topic_name, topic_description, tnx_enabled, DMAAP_OWNER, replication_case, global_mr_url)
# Capture important properties from the result
topic = t.json()