def test_sdp_read_hab_locked(): """Test `read` returns None if HAB locked""" sdp = SDP(VirtualDeviceHabLocked()) assert sdp.is_opened assert sdp.read(0x20000000, 4) is None assert sdp.status_code == StatusCode.HAB_IS_LOCKED assert sdp.response_value == ResponseValue.LOCKED
def test_sdp_read_hab_locked(): """Test `read` returns None if HAB locked""" sdp = SDP( VirtualDevice(respond_sequence=[ CmdResponse(True, pack('>I', ResponseValue.LOCKED)), CmdResponse(False, b"0000"), CmdResponse(True, pack('>I', ResponseValue.HAB_SUCCESS)) ])) assert sdp.is_opened assert sdp.read(0x20000000, 4) assert sdp.status_code == StatusCode.HAB_IS_LOCKED assert sdp.response_value == ResponseValue.LOCKED