def test_get_inbound_numbers(db_session):
    db_session.query(InboundNumber).delete()

    inbound_number_one = sample_inbound_number()
    inbound_number_two = sample_inbound_number()

    db_session.add(inbound_number_one)
    db_session.add(inbound_number_two)
    db_session.commit()

    inbound_numbers = dao_get_inbound_numbers()

    assert inbound_number_one in inbound_numbers
    assert inbound_number_two in inbound_numbers
Пример #2
0
def get_inbound_numbers():
    inbound_numbers = [i.serialize() for i in dao_get_inbound_numbers()]

    return jsonify(data=inbound_numbers if inbound_numbers else [])
Пример #3
0
def test_get_inbound_numbers(notify_db, notify_db_session, sample_inbound_numbers):
    res = dao_get_inbound_numbers()

    assert len(res) == len(sample_inbound_numbers)
    assert res == sample_inbound_numbers