'test for synchronously refreshing table metadata
test_refresh_table_metatadata tests that table metadata is refreshed when calling test_refresh_table_metatadata().
It creates a second cluster object with schema_event_refresh_window=-1 such that schema refreshes are disabled
for schema change push events. It then alters the table, adding a new column, using the first cluster
object, and verifies that the table metadata has not changed in the second cluster object. Finally, it calls
test_refresh_table_metatadata() and verifies that the table metadata is updated in the second cluster object.
@since 2.6.0
@jira_ticket PYTHON-291
@expected_result Table metadata should be refreshed when refresh_table_metadata() is called.
@test_category metadata'

def test_refresh_table_metadata(self):

    table_name = 'test'
    self.session.execute('CREATE    TABLE    {0}.{1}    (a    int    PRIMARY    KEY,    b    text)'.format(self.keyspace_name, table_name))
    cluster2 = Cluster(protocol_version=PROTOCOL_VERSION, schema_event_refresh_window=(-1))
    cluster2.connect()
    self.assertNotIn('c', cluster2.metadata.keyspaces[self.keyspace_name].tables[table_name].columns)
    self.session.execute('ALTER    TABLE    {0}.{1}    ADD    c    double'.format(self.keyspace_name, table_name))
    self.assertNotIn('c', cluster2.metadata.keyspaces[self.keyspace_name].tables[table_name].columns)
    cluster2.refresh_table_metadata(self.keyspace_name, table_name)
    self.assertIn('c', cluster2.metadata.keyspaces[self.keyspace_name].tables[table_name].columns)
    cluster2.shutdown()
