From 5a4de48a6d63cb383832f6ef85b21699a511b755 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 25 May 2018 19:54:38 +0200 Subject: stubbing in a lot of stuff! --- test/module/test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 test/module/test.py (limited to 'test/module/test.py') diff --git a/test/module/test.py b/test/module/test.py new file mode 100755 index 0000000..a0b6493 --- /dev/null +++ b/test/module/test.py @@ -0,0 +1,20 @@ +import importlib.util +spec = importlib.util.spec_from_file_location("module.name", "../../rpc/__main__.py") +CortexRPC = importlib.util.module_from_spec(spec) +spec.loader.exec_module(CortexRPC) + +if __name__ == '__main__': + def get_params(key, value): + print('get params.') + return 'test' + def set_param(key, value): + print('log param. {}: {}'.format(key, value)) + return 'ok' + def ready: + return 'ready' + def process_cmd(cmd, payload): + print('process command', cmd, payload) + return 'processed' + + # this will block + rpc = CortexRPC(get_params, set_param, ready, process_cmd) -- cgit v1.2.3-70-g09d2