Ejemplo n.º 1
0
def test_search_book():
    msg_1, s_c_short_number = maria_f.search_book('123456789')
    msg_2, s_c_ok = maria_f.search_book('9780345539434')
    msg_3, s_c_not_found = maria_f.search_book('9330345539111')

    assertor(s_c_short_number, status_failed)
    assertor(s_c_ok, status_ok)
    assertor(s_c_not_found, status_failed)
Ejemplo n.º 2
0
def search_isbn(isbn):
    obj, status_code = maria_f.search_book(isbn)
    if status_code == 200:
        return make_response(jsonify(obj), status_code)
    else:
        return make_response(obj, status_code)