def test_execute_many(shared_instance, dbapi_database):
    conn = Connection(shared_instance, dbapi_database)
    cursor = conn.cursor()
    row_data = [(1, 'first-name', 'last-name', 'example@example.com'), (2, 'first-name2', 'last-name2', 'example@example.com')]
    cursor.executemany('\nINSERT INTO contacts (contact_id, first_name, last_name, email)\nVALUES (%s, %s, %s, %s)\n    ', row_data)
    conn.commit()
    cursor.executemany('SELECT * FROM contacts WHERE contact_id = @a1', ({'a1': 1}, {'a1': 2}))
    res = cursor.fetchall()
    conn.commit()
    assert (len(res) == len(row_data))
    for (found, expected) in zip(res, row_data):
        assert (found[0] == expected[0])
    cursor.execute('\nSELECT * FROM contacts WHERE contact_id = 1\n')
    res = cursor.fetchone()
    conn.commit()
    assert (res[0] == 1)
    conn.close()
def test_execute_many(shared_instance, dbapi_database):
    conn = Connection(shared_instance, dbapi_database)
    cursor = conn.cursor()
    row_data = [(1, 'first-name', 'last-name', 'example@example.com'), (2, 'first-name2', 'last-name2', 'example@example.com')]
    cursor.executemany('\nINSERT INTO contacts (contact_id, first_name, last_name, email)\nVALUES (%s, %s, %s, %s)\n    ', row_data)
    conn.commit()
    cursor.executemany('SELECT * FROM contacts WHERE contact_id = @a1', ({'a1': 1}, {'a1': 2}))
    res = cursor.fetchall()
    conn.commit()
    assert (len(res) == len(row_data))
    for (found, expected) in zip(res, row_data):
        assert (found[0] == expected[0])
    cursor.execute('\nSELECT * FROM contacts WHERE contact_id = 1\n')
    res = cursor.fetchone()
    conn.commit()
    assert (res[0] == 1)
    conn.close()