def test_ignitor_set_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setGOState(gst, 'a', 1) setGOState(gst, 'b', 1) setGOState(gst, 'c', 1) setIgnitorState(ist, 1) assert getIgnitorState(vst, ist, abt, gst) == 1
def test_check_final_lc_data(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/load_data.txt') lc_data = getLCData(file) assert check_lc_data(lcl, lc_data) == [0, 602, 0]
def test_check_final_pt_data(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/press_data.txt') pt_data = getPTData(file) assert check_pt_data(ptl, pt_data) == [0, 0, 0, 0, 0, 0, 950]
def test_limit_switch_final(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/limit_data.txt') ls_data = getLSData(file) check_limit_switch(abt, vst, ls_data) assert getAbortState(abt) == 1
def test_check_final_tc_data(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/therm_data.txt') tc_data = getTCData(file) assert check_tc_data(tcl, tc_data) == [0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0]
def test_check_final_limits(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/press_data.txt') pt_data_1 = getLCData(file) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/therm_data_2.txt') tc_data_2 = getLCData(file) script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/load_data_2.txt') lc_data_2 = getLCData(file) check_limits(abt, ptl, tcl, lcl, pt_data_1, tc_data_2, lc_data_2) assert getAbortState(abt) == 1
lc_data = getTCData(file_3) parser = ap(description='Test Stand System State') parser.add_argument('-s','--start',action = 'store_true',required = False, help = 'Initialize and output initial system state') parser.add_argument('-n','--nanny',action = 'store_true',required = False, help = 'Turn "Nanny" to "ON"') parser.add_argument('-g','--go',action = 'store_true',required = False, help = 'Turn "GO/NOGO" to "GO" and change ignitor state') parser.add_argument('-t','--test',action = 'store_true',required = False, help = 'Tests system with input sensor data') args = parser.parse_args() if args.start == True: vst, ist, abt, gst, ptl, tcl, lcl = _init_system() print(' ') print(' ') print('Initialize System:') print('(SAFE MODE) Valve State =', getValveState(vst, ist, abt)) print('(SAFE MODE) Ignitor State =', getIgnitorState(vst, ist, abt, gst)) print('(OFF) Nanny =', getNanny(abt)) print('(NOGO) GO/NOGO =', getGOState(gst)) print('(NOMINAL) Abort State =', getAbortState(abt)) print(' ') print(' ') elif args.nanny == True: vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) print(' ') print(' ')
def test_nanny_set_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setNanny(abt, 1) assert getNanny(abt) == 1
def test_abort_set(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setAbortState(abt, 1) assert getAbortState(abt) == 1
def test_go_set_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setGOState(gst, 'b', 1) assert getGOState(gst) == [0, 1, 0]
def test_valve_set_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() setValveState(vst, 'f', 1) assert getValveState(vst, ist, abt) == [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
def test_go_initial_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() assert getGOState(gst) == [0, 0, 0]
def test_ignitor_initial_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() assert getIgnitorState(vst, ist, abt, gst) == 0
def test_valve_initial_state(): vst, ist, abt, gst, ptl, tcl, lcl = _init_system() assert getValveState(vst, ist, abt) == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]