Commit bac5d5e723cf25a9524d96e9467139999b7bdf7e
1 parent
ed7f9eb6
Exists in
dev
test ok avec les 2 simulateurs (sbig et gemini) en meme temps
Showing
3 changed files
with
22 additions
and
5 deletions
Show diff stats
src/core/pyros_django/agent/Agent.py
... | ... | @@ -1430,12 +1430,12 @@ class Agent: |
1430 | 1430 | print("-", nb_unimplemented, "unimplemented command(s) => UnimplementedGenericCmdException raised then command was skipped") |
1431 | 1431 | print("-", nb_unknown, "unknown command(s) => skipped") |
1432 | 1432 | |
1433 | - # Now test that any "get_xx" following a "set_xx value" command has result = value | |
1433 | + # Now test that any "AD get_xx" following a "AD set_xx value" command has result = value | |
1434 | 1434 | for i,cmd_set in enumerate(commands): |
1435 | 1435 | if cmd_set.name.startswith('set_'): |
1436 | 1436 | commands_after = commands[i+1:] |
1437 | 1437 | for cmd_get in commands_after: |
1438 | - if cmd_get.name.startswith('get_') and cmd_get.name[4:]==cmd_set.name[4:]: | |
1438 | + if cmd_get.name.startswith('get_') and cmd_get.name[4:]==cmd_set.name[4:] and cmd_get.device_type==cmd_set.device_type: | |
1439 | 1439 | print("cmd_get.result == cmd_set.args ?", cmd_get.result, cmd_set.args) |
1440 | 1440 | assert cmd_get.get_result() == ','.join(cmd_set.args) |
1441 | 1441 | break | ... | ... |
src/core/pyros_django/agent/AgentMultiRequester.py
... | ... | @@ -30,7 +30,16 @@ class AgentMultiRequester(Agent): |
30 | 30 | |
31 | 31 | TEST_COMMANDS_LIST_GEMINI_AND_SBIG_SIMPLE = [ |
32 | 32 | 'ad_mount do_flush_commands', |
33 | - #'ad_filtersel do_flush_commands', | |
33 | + 'ad_filtersel do_flush_commands', | |
34 | + | |
35 | + # Not executed because not known by Mount (but by the general DC Gemini only) | |
36 | + 'ad_mount get_date', | |
37 | + | |
38 | + # for test purpose only | |
39 | + 'ad_sensor get_date', | |
40 | + 'ad_sensor set_date 21/10/19', | |
41 | + 'ad_sensor get_date', | |
42 | + | |
34 | 43 | 'ad_mount get_ra', |
35 | 44 | #'ad_mount get_dec', |
36 | 45 | #'ad_mount get_radec', |
... | ... | @@ -43,8 +52,10 @@ class AgentMultiRequester(Agent): |
43 | 52 | 'ad_mount get_radec', |
44 | 53 | 'ad_mount set_radec 15:20:51 +87:57:48', |
45 | 54 | 'ad_mount get_radec', |
55 | + | |
56 | + # Optional | |
46 | 57 | 'ad_mount do_exit', |
47 | - #'ad_filtersel do_exit', | |
58 | + 'ad_filtersel do_exit', | |
48 | 59 | ] |
49 | 60 | TEST_COMMANDS_LIST_GEMINI_AND_SBIG = [ |
50 | 61 | # Ask receiver to delete all its previous commands |
... | ... | @@ -212,8 +223,8 @@ class AgentMultiRequester(Agent): |
212 | 223 | |
213 | 224 | ] |
214 | 225 | |
215 | - TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_SBIG_ONLY | |
216 | 226 | TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_GEMINI_AND_SBIG |
227 | + TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_SBIG_ONLY | |
217 | 228 | TEST_COMMANDS_LIST = TEST_COMMANDS_LIST_GEMINI_AND_SBIG_SIMPLE |
218 | 229 | |
219 | 230 | ... | ... |
src/device_controller/concrete_component/sbig/sbig_controller.py
... | ... | @@ -233,6 +233,12 @@ class DC_SBIG(DeviceController): |
233 | 233 | 'do_sync': ['GC'], |
234 | 234 | } |
235 | 235 | GEN2NAT_CMDS_SENSOR = { |
236 | + # General commands (for test only because these commands should be in the GENERAL level above) | |
237 | + 'get_date': ['GC', '20/10/19'], | |
238 | + 'set_date': ['SC'], | |
239 | + #'get_time': ['GL', '20:20:36'], | |
240 | + #'set_time': ['SL'], | |
241 | + | |
236 | 242 | 'do_init': ['GC'], |
237 | 243 | 'do_start_acq': ['GC'], |
238 | 244 | 'do_stop_acq': ['GC'], | ... | ... |