コード例 #1
0
ファイル: test_consumer.py プロジェクト: o-ran-sc/smo-ves
def test_getTopicDetails(mocker, prepareResponse, topic, topic_list, resCode):
    mocker.patch('confluent_kafka.admin.AdminClient.list_topics',
                 return_value=topic_list)
    TopicConsumer.getTopicDetails(TopicConsumer, prepareResponse, topic)
    resMsg = '{"name": "test1", "owner": "", "description": "", "readerAcl": {"enabled": true, "users": []}, "writerAcl": {"enabled": true, "users": []}}'
    assert resCode == prepareResponse.getResponseCode()
    assert resMsg == prepareResponse.getResponseMsg()
コード例 #2
0
ファイル: dmaap_adapter.py プロジェクト: o-ran-sc/smo-ves
def topic_details(topic):
    topic == request.view_args['topic']
    prepareResponse = PrepareResponse()
    topicConsumer = TopicConsumer()
    topicConsumer.getTopicDetails(prepareResponse, topic)
    response = app.response_class(response=prepareResponse.getResponseMsg(),
                                  status=prepareResponse.getResponseCode(),
                                  mimetype='application/json')
    return response