Beispiel #1
0
def test_messageIDSimple(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    b.connect(a.port)

    mid = b.send(data_in)

    assert b.is_acknowledged(mid) == False

    data_out = a.recv(timeout=0.5)
    b.recv(timeout=0.5)

    assert data_out == data_in
    assert b.is_acknowledged(mid) == True
Beispiel #2
0
def test_messageIDSimple(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    b.connect(a.port)

    mid = b.send(data_in)

    assert b.is_acknowledged(mid) == False

    data_out = a.recv(timeout=0.5)
    b.recv(timeout=0.5)

    assert data_out == data_in
    assert b.is_acknowledged(mid) == True
Beispiel #3
0
def test_messageIDNonListening(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    b.connect(a.port)
    a.shutdown()

    mid = b.send(data_in)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False
Beispiel #4
0
def test_messageIDNonListening(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    b.connect(a.port)
    a.shutdown()

    mid = b.send(data_in)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False
Beispiel #5
0
def test_messageIDInterruption(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    serv_port = a.port
    b.connect(serv_port)
    a.shutdown()

    mid = b.send(data_in)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False

    a.listen(serv_port)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False

    a.recv(timeout=0.5)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == True
Beispiel #6
0
def test_messageIDInterruption(data_in):
    a = Comm()
    b = Comm()
    a.listen()
    serv_port = a.port
    b.connect(serv_port)
    a.shutdown()

    mid = b.send(data_in)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False

    a.listen(serv_port)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == False

    a.recv(timeout=0.5)
    b.recv(timeout=0.5)

    assert b.is_acknowledged(mid) == True