def test_commit(shared_instance, dbapi_database):
    'Test committing a transaction with several statements.'
    want_row = (1, 'updated-first-name', 'last-name', 'example@example.com')
    conn = Connection(shared_instance, dbapi_database)
    cursor = conn.cursor()
    cursor.execute("\nINSERT INTO contacts (contact_id, first_name, last_name, email)\nVALUES (1, 'first-name', 'last-name', 'example@example.com')\n    ")
    cursor.execute("\nUPDATE contacts\nSET first_name = 'updated-first-name'\nWHERE first_name = 'first-name'\n")
    cursor.execute("\nUPDATE contacts\nSET email = 'example@example.com'\nWHERE email = 'example@example.com'\n")
    conn.commit()
    cursor.execute('SELECT * FROM contacts')
    got_rows = cursor.fetchall()
    conn.commit()
    assert (got_rows == [want_row])
    cursor.close()
    conn.close()
Test committing a transaction with several statements.
def test_commit(shared_instance, dbapi_database):
    
    want_row = (1, 'updated-first-name', 'last-name', 'example@example.com')
    conn = Connection(shared_instance, dbapi_database)
    cursor = conn.cursor()
    cursor.execute("\nINSERT INTO contacts (contact_id, first_name, last_name, email)\nVALUES (1, 'first-name', 'last-name', 'example@example.com')\n    ")
    cursor.execute("\nUPDATE contacts\nSET first_name = 'updated-first-name'\nWHERE first_name = 'first-name'\n")
    cursor.execute("\nUPDATE contacts\nSET email = 'example@example.com'\nWHERE email = 'example@example.com'\n")
    conn.commit()
    cursor.execute('SELECT * FROM contacts')
    got_rows = cursor.fetchall()
    conn.commit()
    assert (got_rows == [want_row])
    cursor.close()
    conn.close()