Commit 5e149417 authored by Federico Sismondi's avatar Federico Sismondi

updated doc, fixed modules imports, etc..

parent 91b9639e
Pipeline #2207 passed with stage
in 0 seconds
import os import os
from os.path import expanduser
import sys import sys
import pika import pika
import errno
import base64 import base64
import logging import logging
import threading import threading
import traceback import traceback
from collections import OrderedDict from collections import OrderedDict
import click import click
...@@ -24,7 +27,9 @@ except: ...@@ -24,7 +27,9 @@ except:
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.WARNING) logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.WARNING)
COMPONENT_ID = 'CLI' COMPONENT_ID = 'ioppytest-cli'
HOME = expanduser("~")
# click colors:: black (might gray) , red, green, yellow (might be an orange), blue, magenta, cyan, white (might gray) # click colors:: black (might gray) , red, green, yellow (might be an orange), blue, magenta, cyan, white (might gray)
COLOR_DEFAULT = 'white' COLOR_DEFAULT = 'white'
...@@ -96,9 +101,19 @@ def repl(): ...@@ -96,9 +101,19 @@ def repl():
""" """
Interactive shell, allows user to interact with the ioppytest testing tool Interactive shell, allows user to interact with the ioppytest testing tool
""" """
history_path_file = "{dir}{sep}{comp_name}-history".format(dir=HOME, sep=os.path.sep, comp_name=COMPONENT_ID)
if not os.path.exists(os.path.dirname(history_path_file)):
try:
os.makedirs(os.path.dirname(history_path_file))
except OSError as exc: # Guard against race condition
if exc.errno != errno.EEXIST:
raise
prompt_kwargs = { prompt_kwargs = {
'history': FileHistory('tmp/myrepl-history'), 'history': FileHistory(history_path_file),
} }
_echo_log_message('saving CMD history at: {}'.format(history_path_file))
_echo_welcome_message() _echo_welcome_message()
_pre_configuration() _pre_configuration()
...@@ -217,7 +232,6 @@ def gui_display_message(text_message, user_id): ...@@ -217,7 +232,6 @@ def gui_display_message(text_message, user_id):
if user_id: if user_id:
msg_display.routing_key = "ui.user.{}.display".format(user_id) msg_display.routing_key = "ui.user.{}.display".format(user_id)
_publish_message(msg_display) _publish_message(msg_display)
_echo_input("message display sent to {}".format(msg_display.routing_key)) _echo_input("message display sent to {}".format(msg_display.routing_key))
...@@ -919,7 +933,7 @@ def _echo_backend_message(msg): ...@@ -919,7 +933,7 @@ def _echo_backend_message(msg):
assert isinstance(msg, Message) assert isinstance(msg, Message)
try: try:
m = "\n[Session message] [%s] " % type(msg) m = "\n[Event bus message] [%s] " % type(msg)
if hasattr(m, 'description'): if hasattr(m, 'description'):
m += m.description m += m.description
......
...@@ -5,17 +5,17 @@ ...@@ -5,17 +5,17 @@
About the library: About the library:
----------------- -----------------
This module provides the API message formats used in F-Interop. This module provides the API message formats used by ioppytest test framework.
The idea is to be able to have an The idea is to be able to have an
- organized and centralized way of dealing with the big amount of messages formats used in the platform; - organized and centralized way of dealing with the big amount of messages formats used in the platform;
- to be able to import (or just copy/paste) these messages formats from any component in the F-Interop platform, - to be able to import (or just copy/paste) these messages for interacting with components on the event bus ,
- re-use this also for the integration testing; - re-use this also for the integration testing;
- to have version control the messages e.g. messages_testcase_start API v1 and API v2; - to have version control the messages e.g. messages_testcase_start API v1 and API v2;
- to have a direct way of exporting this as doc. - to have a direct way of exporting this as doc.
F-Interop conventions: Some conventions:
--------------------- ---------------------
- if event is a service request then the routing key (r_key) is someRpcExecutionEvent.request - if event is a service request then the routing key (r_key) is someRpcExecutionEvent.request
- a reply to a service will be on topic/r_key : someRpcExecutionEvent.reply - a reply to a service will be on topic/r_key : someRpcExecutionEvent.reply
......
...@@ -11,8 +11,9 @@ MINOR = 1 ...@@ -11,8 +11,9 @@ MINOR = 1
PATCH = 2 PATCH = 2
VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH) VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)
name = 'ioppytest-cli' name = 'ioppytest-utils'
description = "Command line interface for interacting with ioppytest testing tool (all interactions happen over AMQP even bus)." description = "Command line interface for interacting with ioppytest testing tool " \
"(all interactions happen over AMQP even bus)."
CLASSIFIERS = [ CLASSIFIERS = [
"Development Status :: 3 - Alpha", "Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research", "Intended Audience :: Science/Research",
...@@ -39,12 +40,15 @@ with open("version.py", "w") as f: ...@@ -39,12 +40,15 @@ with open("version.py", "w") as f:
setup( setup(
name=name, name=name,
author='Federico Sismondi', author='Federico Sismondi',
author_email="federico.sismondi@gmail.com", author_email="federicosismondi@gmail.com",
maintainer='Federico Sismondi',
maintainer_email="federicosismondi@gmail.com",
description=description, description=description,
version=VERSION, version=VERSION,
license="??", license="??",
classifiers=CLASSIFIERS, classifiers=CLASSIFIERS,
packages=find_packages(exclude=["tests"]), packages=find_packages(exclude=["tests"]),
py_modules=['tabulate', 'event_bus_utils'],
long_description=io.open('README.md', 'r', encoding='utf-8').read(), long_description=io.open('README.md', 'r', encoding='utf-8').read(),
install_requires=[ install_requires=[
'click==6.7', 'click==6.7',
......
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