'Ensure AlreadyExists exception is thrown when hit'

def test_already_exists_exceptions(self):

    cluster = Cluster(protocol_version=PROTOCOL_VERSION)
    session = cluster.connect()
    ksname = 'test3rf'
    cfname = 'test'
    ddl = "\n                                                CREATE    KEYSPACE    %s\n                                                WITH    replication    =    {'class':    'SimpleStrategy',    'replication_factor':    '3'}"
    self.assertRaises(AlreadyExists, session.execute, (ddl % ksname))
    ddl = '\n                                                CREATE    TABLE    %s.%s    (\n                                                                k    int    PRIMARY    KEY,\n                                                                v    int    )'
    self.assertRaises(AlreadyExists, session.execute, (ddl % (ksname, cfname)))
    cluster.shutdown()
