def test_recv(self, tco, pdu): assert tco.enqueue(pdu) is True assert tco.enqueue(pdu) is False tco.setsockopt(nfc.llcp.SO_RCVBUF, 2) assert tco.enqueue(pdu) is True assert tco.enqueue(pdu) is False assert tco.recv() == pdu assert tco.recv() == pdu threading.Timer(0.01, tco.enqueue, (pdu, )).start() tco.recv()
def test_recv(self, tco, pdu): assert tco.enqueue(pdu) is True assert tco.enqueue(pdu) is False tco.setsockopt(nfc.llcp.SO_RCVBUF, 2) assert tco.enqueue(pdu) is True assert tco.enqueue(pdu) is False assert tco.recv() == pdu assert tco.recv() == pdu threading.Timer(0.01, tco.enqueue, (pdu,)).start() tco.recv()
def test_recv(self, tco): pdu = nfc.llcp.pdu.UnnumberedInformation(1, 1, HEX('1122')) assert tco.enqueue(pdu) is True assert tco.recv() == pdu threading.Timer(0.01, tco.close).start() with pytest.raises(nfc.llcp.Error) as excinfo: tco.recv() assert excinfo.value.errno == errno.EPIPE with pytest.raises(nfc.llcp.Error) as excinfo: tco.recv() assert excinfo.value.errno == errno.ESHUTDOWN
def test_recv_while_not_established(self, tco): with pytest.raises(nfc.llcp.Error) as excinfo: tco.recv() assert excinfo.value.errno == errno.ENOTCONN