diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test/module/test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/module/test.py b/test/module/test.py index 9146c14..b9e7059 100755 --- a/test/module/test.py +++ b/test/module/test.py @@ -1,7 +1,8 @@ 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) +spec = importlib.util.spec_from_file_location("CortexRPC", "../../rpc/rpc.py") +rpc_module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(rpc_module) +CortexRPC = rpc_module.CortexRPC if __name__ == '__main__': def get_params(key, value): @@ -10,7 +11,7 @@ if __name__ == '__main__': def set_param(key, value): print('log param. {}: {}'.format(key, value)) return 'ok' - def ready: + def ready(key): return 'ready' def process_cmd(cmd, payload): print('process command', cmd, payload) |
