def test_recvfrom(self, tco):
pdu = nfc.llcp.pdu.Symmetry()
assert tco.enqueue(pdu) is False
pdu = nfc.llcp.pdu.UnnumberedInformation(1, 1, (tco.recv_miu+1) * b'1')
assert tco.enqueue(pdu) is False
pdu = nfc.llcp.pdu.UnnumberedInformation(1, 1, HEX('1122'))
assert tco.enqueue(pdu) is True
assert tco.recvfrom() == (pdu.data, pdu.ssap)
threading.Timer(0.01, tco.close).start()
with pytest.raises(nfc.llcp.Error) as excinfo:
tco.recvfrom()
assert excinfo.value.errno == errno.EPIPE
with pytest.raises(nfc.llcp.Error) as excinfo:
tco.recvfrom()
assert excinfo.value.errno == errno.ESHUTDOWN
# =============================================================================
# Data Link Connection
# =============================================================================
评论列表
文章目录