'Test for inserting wide row of bytes
test_wide_batch_rows tests inserting a wide row of data bytes. It will then attempt to query
that data and ensure that all of it has been inserted appropriately.
@expected_result all items should be inserted, and verified.
@test_category queries'

def test_wide_byte_rows(self):

    table = 'wide_byte_rows'
    session = self.make_session_and_keyspace()
    session.execute(('CREATE    TABLE    %s    (k    INT,    i    INT,    v    BLOB,    PRIMARY    KEY(k,    i))' % table))
    to_insert = 100000
    prepared = session.prepare(('INSERT    INTO    %s    (k,    i,    v)    VALUES    (0,    ?,    0xCAFE)' % (table,)))
    timeouts = self.batch_futures(session, (prepared.bind((i,)) for i in range(to_insert)))
    results = session.execute(('SELECT    i,    v    FROM    %s    WHERE    k=0' % (table,)))
    expected_results = ((to_insert - timeouts) - 1)
    bb = pack('>H', 51966)
    for (i, row) in enumerate(results):
        self.assertEqual(row['v'], bb)
    self.assertGreaterEqual(i, expected_results, 'Verification    failed    only    found    {0}    inserted    we    were    expecting    {1}'.format(i, expected_results))
    session.cluster.shutdown()
