From bac5d5e723cf25a9524d96e9467139999b7bdf7e Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Wed, 27 Nov 2019 17:56:07 +0100 Subject: [PATCH] test ok avec les 2 simulateurs (sbig et gemini) en meme temps --- src/core/pyros_django/agent/Agent.py | 4 ++-- src/core/pyros_django/agent/AgentMultiRequester.py | 17 ++++++++++++++--- src/device_controller/concrete_component/sbig/sbig_controller.py | 6 ++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/core/pyros_django/agent/Agent.py b/src/core/pyros_django/agent/Agent.py index 06378e5..1fef773 100755 --- a/src/core/pyros_django/agent/Agent.py +++ b/src/core/pyros_django/agent/Agent.py @@ -1430,12 +1430,12 @@ class Agent: print("-", nb_unimplemented, "unimplemented command(s) => UnimplementedGenericCmdException raised then command was skipped") print("-", nb_unknown, "unknown command(s) => skipped") - # Now test that any "get_xx" following a "set_xx value" command has result = value + # Now test that any "AD get_xx" following a "AD set_xx value" command has result = value for i,cmd_set in enumerate(commands): if cmd_set.name.startswith('set_'): commands_after = commands[i+1:] for cmd_get in commands_after: - if cmd_get.name.startswith('get_') and cmd_get.name[4:]==cmd_set.name[4:]: + if cmd_get.name.startswith('get_') and cmd_get.name[4:]==cmd_set.name[4:] and cmd_get.device_type==cmd_set.device_type: print("cmd_get.result == cmd_set.args ?", cmd_get.result, cmd_set.args) assert cmd_get.get_result() == ','.join(cmd_set.args) break diff --git a/src/core/pyros_django/agent/AgentMultiRequester.py b/src/core/pyros_django/agent/AgentMultiRequester.py index 9899677..16bb5ca 100755 --- a/src/core/pyros_django/agent/AgentMultiRequester.py +++ b/src/core/pyros_django/agent/AgentMultiRequester.py @@ -30,7 +30,16 @@ class AgentMultiRequester(Agent): TEST_COMMANDS_LIST_GEMINI_AND_SBIG_SIMPLE = [ 'ad_mount do_flush_commands', - #'ad_filtersel do_flush_commands', + 'ad_filtersel do_flush_commands', + + # Not executed because not known by Mount (but by the general DC Gemini only) + 'ad_mount get_date', + + # for test purpose only + 'ad_sensor get_date', + 'ad_sensor set_date 21/10/19', + 'ad_sensor get_date', + 'ad_mount get_ra', #'ad_mount get_dec', #'ad_mount get_radec', @@ -43,8 +52,10 @@ class AgentMultiRequester(Agent): 'ad_mount get_radec', 'ad_mount set_radec 15:20:51 +87:57:48', 'ad_mount get_radec', + + # Optional 'ad_mount do_exit', - #'ad_filtersel do_exit', + 'ad_filtersel do_exit', ] TEST_COMMANDS_LIST_GEMINI_AND_SBIG = [ # Ask receiver to delete all its previous commands @@ -212,8 +223,8 @@ class AgentMultiRequester(Agent): ] - TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_SBIG_ONLY TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_GEMINI_AND_SBIG + TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_SBIG_ONLY TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_GEMINI_AND_SBIG_SIMPLE diff --git a/src/device_controller/concrete_component/sbig/sbig_controller.py b/src/device_controller/concrete_component/sbig/sbig_controller.py index 4e7eeff..4ff4e49 100755 --- a/src/device_controller/concrete_component/sbig/sbig_controller.py +++ b/src/device_controller/concrete_component/sbig/sbig_controller.py @@ -233,6 +233,12 @@ class DC_SBIG(DeviceController): 'do_sync': ['GC'], } GEN2NAT_CMDS_SENSOR = { + # General commands (for test only because these commands should be in the GENERAL level above) + 'get_date': ['GC', '20/10/19'], + 'set_date': ['SC'], + #'get_time': ['GL', '20:20:36'], + #'set_time': ['SL'], + 'do_init': ['GC'], 'do_start_acq': ['GC'], 'do_stop_acq': ['GC'], -- libgit2 0.21.2