From 29ff014f5475a10f48f1bf8dc79e582db341001d Mon Sep 17 00:00:00 2001 From: chutaro <35984595+chutaro@users.noreply.github.com> Date: Tue, 28 Feb 2023 11:38:16 +0900 Subject: [PATCH] modify pytest --- .../TlmCmd/test_command_dispatcher.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Examples/minimum_user/src/src_user/Test/test/src_core/TlmCmd/test_command_dispatcher.py b/Examples/minimum_user/src/src_user/Test/test/src_core/TlmCmd/test_command_dispatcher.py index dc26c2c37..e0372b5b6 100644 --- a/Examples/minimum_user/src/src_user/Test/test/src_core/TlmCmd/test_command_dispatcher.py +++ b/Examples/minimum_user/src/src_user/Test/test/src_core/TlmCmd/test_command_dispatcher.py @@ -3,7 +3,6 @@ import os import sys -import time import isslwings as wings import pytest @@ -27,17 +26,17 @@ def test_cdis_exec_err(): # RT Cmd_CODE_TMGR_UPDATE_UNIXTIME # RT Cmd_CODE_AM_SET_PAGE_FOR_TLM - check_cdis_exec_err(c2a_enum.Cmd_CODE_TMGR_UPDATE_UNIXTIME, (-10, 0, 0)) - check_cdis_exec_err(c2a_enum.Cmd_CODE_AM_SET_PAGE_FOR_TLM, (AM_TLM_PAGE_MAX + 100,)) + check_param_err(c2a_enum.Cmd_CODE_TMGR_UPDATE_UNIXTIME, (-10, 0, 0)) + check_param_err(c2a_enum.Cmd_CODE_AM_SET_PAGE_FOR_TLM, (AM_TLM_PAGE_MAX + 100,)) - # === 最後にもう一度初期化 + # === 最後にもう一度初期化 === assert "SUC" == wings.util.send_rt_cmd_and_confirm( ope, c2a_enum.Cmd_CODE_EL_INIT, (), c2a_enum.Tlm_CODE_HK ) -def check_cdis_exec_err(cmd_id, params): - # === ELの初期化 +def check_param_err(cmd_id, params): + # === ELの初期化 === assert "SUC" == wings.util.send_rt_cmd_and_confirm( ope, c2a_enum.Cmd_CODE_EL_INIT, (), c2a_enum.Tlm_CODE_HK ) @@ -45,18 +44,18 @@ def check_cdis_exec_err(cmd_id, params): ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL ) - # === 引数が不正な コマンドチェック assert "PRM" == wings.util.send_rt_cmd_and_confirm(ope, cmd_id, params, c2a_enum.Tlm_CODE_HK) - # === ELのチェック + # === ELのチェック === tlm_EL = wings.util.generate_and_receive_tlm( ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL ) - assert tlm_EL["EL.TLOGS.LOW.EVENTS0.GROUP"] == c2a_enum.EL_CORE_GROUP_CDIS_EXEC_ERR assert tlm_EL["EL.TLOGS.LOW.EVENTS0.LOCAL"] == cmd_id + err_code = 0 assert ( - tlm_EL["EL.TLOGS.LOW.EVENTS0.NOTE"] == (cmd_id << 0) | c2a_enum.CCP_EXEC_ILLEGAL_PARAMETER + tlm_EL["EL.TLOGS.LOW.EVENTS0.NOTE"] + == (err_code << 16) | c2a_enum.CCP_EXEC_ILLEGAL_PARAMETER )