예제 #1
0
def test_get_from_child1():
    qc = QueueComms()
    qc.child_queue.put("2")
    assert qc.get_from_child() == "2"
예제 #2
0
def test_get_from_parent1():
    qc = QueueComms()
    qc.parent_queue.put("2")
    assert qc.get_from_parent() == "2"
예제 #3
0
def test_get_from_parent2():
    qc = QueueComms()
    assert qc.get_from_parent() == None
예제 #4
0
def test_queued_for_parent1():
    qc = QueueComms()
    qc.parent_queue.put("2")
    qc.parent_queue.get()
    assert qc.queued_for_parent() == False
예제 #5
0
def test_get_from_parent1():
    qc = QueueComms()
    qc.parent_queue.put("2")
    assert (qc.get_from_parent() == "2")
예제 #6
0
def test_queued_for_child2():
    qc = QueueComms()
    qc.child_queue.put("2")
    assert qc.queued_for_child() == True
예제 #7
0
def test_queue_value_error_child2():
    qc = QueueComms()
    with pytest.raises(ValueError):
        qc.signal_child("overflow")
예제 #8
0
def test_queue_max_size_child1():
    qc = QueueComms()
    for i in range(QUEUE_MAX_SIZE):
        qc.send_to_child(i)
    with pytest.raises(Full):
        qc.send_to_child("overflow")
예제 #9
0
def test_queue_value_error_child2():
    qc = QueueComms()
    with pytest.raises(ValueError):
        qc.signal_child("overflow")
예제 #10
0
def test_queued_for_child1():
    qc = QueueComms()
    qc.child_queue.put("2")
    qc.child_queue.get()
    assert (qc.queued_for_child() == False)
예제 #11
0
def test_queued_for_child2():
    qc = QueueComms()
    qc.child_queue.put("2")
    assert (qc.queued_for_child() == True)
예제 #12
0
def test_get_from_child2():
    qc = QueueComms()
    assert (qc.get_from_child() == None)
예제 #13
0
def test_get_from_child1():
    qc = QueueComms()
    qc.child_queue.put("2")
    assert (qc.get_from_child() == "2")
예제 #14
0
def test_get_from_parent2():
    qc = QueueComms()
    assert (qc.get_from_parent() == None)
예제 #15
0
def test_get_from_child2():
    qc = QueueComms()
    assert qc.get_from_child() == None
예제 #16
0
def test_queue_value_error_parent2():
    qc = QueueComms()
    with pytest.raises(ValueError):
        qc.signal_parent("overflow")
예제 #17
0
def test_queued_for_child1():
    qc = QueueComms()
    qc.child_queue.put("2")
    qc.child_queue.get()
    assert qc.queued_for_child() == False
예제 #18
0
def test_queued_for_parent1():
    qc = QueueComms()
    qc.parent_queue.put("2")
    qc.parent_queue.get()
    assert (qc.queued_for_parent() == False)
예제 #19
0
def test_queue_max_size_child1():
    qc = QueueComms()
    for i in range(QUEUE_MAX_SIZE):
        qc.send_to_child(i)
    with pytest.raises(Full):
        qc.send_to_child("overflow")
예제 #20
0
def test_queue_max_size_parent3():
    qc = QueueComms()
    for i in range(QUEUE_MAX_SIZE):
        qc.signal_parent(i)
    with pytest.raises(Full):
        qc.signal_parent(1)
예제 #21
0
def test_queue_value_error_parent2():
    qc = QueueComms()
    with pytest.raises(ValueError):
        qc.signal_parent("overflow")
예제 #22
0
def test_queued_for_parent2():
    qc = QueueComms()
    qc.parent_queue.put("2")
    assert qc.queued_for_parent() == True
예제 #23
0
def test_queue_max_size_parent3():
    qc = QueueComms()
    for i in range(QUEUE_MAX_SIZE):
        qc.signal_parent(i)
    with pytest.raises(Full):
        qc.signal_parent(1)
예제 #24
0
def test_queued_for_parent2():
    qc = QueueComms()
    qc.parent_queue.put("2")
    assert (qc.queued_for_parent() == True)