'Basic test for repeated schema creation and use, using many different keyspaces'

def test_recreates(self):

    session = self.session
    for i in range(2):
        for keyspace_number in range(5):
            keyspace = 'ks_{0}'.format(keyspace_number)
            if (keyspace in self.cluster.metadata.keyspaces.keys()):
                drop = 'DROP    KEYSPACE    {0}'.format(keyspace)
                log.debug(drop)
                execute_until_pass(session, drop)
            create = "CREATE    KEYSPACE    {0}    WITH    replication    =    {{'class':    'SimpleStrategy',    'replication_factor':    3}}".format(keyspace)
            log.debug(create)
            execute_until_pass(session, create)
            create = 'CREATE    TABLE    {0}.cf    (k    int    PRIMARY    KEY,    i    int)'.format(keyspace)
            log.debug(create)
            execute_until_pass(session, create)
            use = 'USE    {0}'.format(keyspace)
            log.debug(use)
            execute_until_pass(session, use)
            insert = 'INSERT    INTO    cf    (k,    i)    VALUES    (0,    0)'
            log.debug(insert)
            ss = SimpleStatement(insert, consistency_level=ConsistencyLevel.QUORUM)
            execute_until_pass(session, ss)
