Commit 3b7d60b4 authored by Federico Sismondi's avatar Federico Sismondi

Merge branch 'some_modifs_and_patches' into 'master'

Some modifs and patches

See merge request !17
parents 4f403ad5 f25a6d2f
Pipeline #2384 passed with stage
in 0 seconds
......@@ -276,7 +276,6 @@ if __name__ == '__main__':
except KeyError as e:
AMQP_URL = "amqp://guest:guest@localhost/"
def callback_function(message_received):
print("Callback function received: \n\t" + repr(message_received))
......@@ -323,7 +322,12 @@ if __name__ == '__main__':
con = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
channel = con.channel()
ui_request = MsgUiRequestConfirmationButton()
print("publishing .. %s" % repr(ui_request))
ui_reply = amqp_request(con, ui_request, 'dummy_component')
print(repr(ui_reply))
# ui_request = MsgUiRequestConfirmationButton()
# print("publishing .. %s" % repr(ui_request))
# ui_reply = amqp_request(con, ui_request, 'dummy_component')
# print(repr(ui_reply))
req = MsgUiRequestSessionConfiguration()
ui_reply = amqp_request(con, req,'dummy_component')
print(ui_reply.users)
\ No newline at end of file
......@@ -199,6 +199,7 @@ def gui_request_file_upload(path_to_file, text_message, user_id):
if user_id:
msg_request.routing_key = "ui.user.{}.request".format(user_id)
msg_request.reply_to = "ui.user.{}.reply".format(user_id)
_echo_input("sending request to {}".format(msg_request.routing_key))
msg_response = _amqp_request(msg_request, COMPONENT_ID, timeout=WAIT_TIME_FOR_USER_INPUT)
......
......@@ -26,7 +26,7 @@ Usage:
------
>>> m = MsgTestCaseSkip(testcase_id = 'some_testcase_id')
>>> m
MsgTestCaseSkip(_api_version = 1.0.17, description = Skip testcase, node = someNode, testcase_id = some_testcase_id, )
MsgTestCaseSkip(_api_version = 1.0.18, description = Skip testcase, node = someNode, testcase_id = some_testcase_id, )
>>> m.routing_key
'testsuite.testcase.skip'
>>> m.message_id # doctest: +SKIP
......@@ -37,24 +37,24 @@ MsgTestCaseSkip(_api_version = 1.0.17, description = Skip testcase, node = someN
# also we can modify some of the fields (rewrite the default ones)
>>> m = MsgTestCaseSkip(testcase_id = 'TD_COAP_CORE_03')
>>> m
MsgTestCaseSkip(_api_version = 1.0.17, description = Skip testcase, node = someNode, testcase_id = TD_COAP_CORE_03, )
MsgTestCaseSkip(_api_version = 1.0.18, description = Skip testcase, node = someNode, testcase_id = TD_COAP_CORE_03, )
>>> m.testcase_id
'TD_COAP_CORE_03'
# and even export the message in json format (for example for sending the message though the amqp event bus)
>>> m.to_json()
'{"_api_version": "1.0.17", "description": "Skip testcase", "node": "someNode", "testcase_id": "TD_COAP_CORE_03"}'
'{"_api_version": "1.0.18", "description": "Skip testcase", "node": "someNode", "testcase_id": "TD_COAP_CORE_03"}'
# We can use the Message class to import json into Message objects:
>>> m=MsgTestSuiteStart()
>>> m.routing_key
'testsuite.start'
>>> m.to_json()
'{"_api_version": "1.0.17", "description": "Test suite START command"}'
'{"_api_version": "1.0.18", "description": "Test suite START command"}'
>>> json_message = m.to_json()
>>> obj=Message.load(json_message,'testsuite.start', None )
>>> obj
MsgTestSuiteStart(_api_version = 1.0.17, description = Test suite START command, )
MsgTestSuiteStart(_api_version = 1.0.18, description = Test suite START command, )
>>> type(obj) # doctest: +SKIP
<class 'messages.MsgTestSuiteStart'>
......@@ -66,7 +66,7 @@ MsgTestSuiteStart(_api_version = 1.0.17, description = Test suite START command,
# the error reply (note that we pass the message of the request to build the reply):
>>> err = MsgErrorReply(m)
>>> err
MsgErrorReply(_api_version = 1.0.17, error_code = None, error_message = None, ok = False, )
MsgErrorReply(_api_version = 1.0.18, error_code = None, error_message = None, ok = False, )
# properties of the message are auto-generated:
>>> m.reply_to
......@@ -91,7 +91,7 @@ import time
import json
import uuid
API_VERSION = '1.0.17'
API_VERSION = '1.0.18'
class NonCompliantMessageFormatError(Exception):
......@@ -201,10 +201,10 @@ class Message(object):
>>> m.routing_key
'sniffing.getcapture.request'
>>> m.to_json()
'{"_api_version": "1.0.17", "capture_id": "TD_COAP_CORE_01"}'
'{"_api_version": "1.0.18", "capture_id": "TD_COAP_CORE_01"}'
>>> json_message = m.to_json()
>>> json_message
'{"_api_version": "1.0.17", "capture_id": "TD_COAP_CORE_01"}'
'{"_api_version": "1.0.18", "capture_id": "TD_COAP_CORE_01"}'
>>> obj=Message.load(json_message,'testsuite.start', None )
>>> type(obj) # doctest
<class 'messages.MsgTestSuiteStart'>
......
......@@ -248,6 +248,16 @@ if __name__ == '__main__':
MsgTestCaseVerdict,
MsgTestSuiteReport,
MsgTestingToolTerminate,
MsgSniffingStart,
MsgSniffingStop,
MsgSniffingGetCapture,
MsgSniffingGetCaptureLast,
MsgDissectionDissectCapture,
MsgDissectionDissectCaptureReply,
MsgInteropTestCaseAnalyze,
MsgInteropTestCaseAnalyzeReply,
]
so_messages = [
......
......@@ -4,9 +4,9 @@
import io
from setuptools import setup, find_packages
MAJOR = 0
MINOR = 1
PATCH = 2
MAJOR = 1
MINOR = 0
PATCH = 18
VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)
name = 'ioppytest-utils'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment