Skip to content

Commit

Permalink
modify pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
chutaro committed Feb 28, 2023
1 parent 2de9689 commit 29ff014
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import os
import sys
import time

import isslwings as wings
import pytest
Expand All @@ -27,36 +26,36 @@ 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
)
tlm_EL = wings.util.generate_and_receive_tlm(
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
)


Expand Down

0 comments on commit 29ff014

Please sign in to comment.