#NEWLINE# def test_alter_column( self ) : #NEWLINE# #INDENT# resp = _make_query ( self . client , 'CREATE TABLE test_alter_column (before_alter int);' , database = self . db_name ) #NEWLINE# resp = wait_for_query_to_finish ( self . client , resp , max = 30.0 ) #NEWLINE# resp = self . client . get ( ( '/metastore/table/%s/test_alter_column' % self . db_name ) ) #NEWLINE# assert_true ( 'before_alter' , resp . content ) #NEWLINE# assert_true ( 'int' , resp . content ) #NEWLINE# resp = self . client . post ( reverse ( 'metastore:alter_column' , kwargs = { #NEWLINE# #INDENT# 'database' : self . db_name , #NEWLINE# 'table' : 'test_alter_column' , #NEWLINE# #UNINDENT# } ) , { #NEWLINE# #INDENT# 'column' : 'before_alter' , #NEWLINE# 'new_column_name' : 'after_alter' , #NEWLINE# 'new_column_type' : 'string' , #NEWLINE# 'comment' : 'alter comment' , #NEWLINE# #UNINDENT# } ) #NEWLINE# json_resp = json . loads ( resp . content ) #NEWLINE# assert_equal ( 'after_alter' , json_resp [ 'data' ] [ 'name' ] , json_resp ) #NEWLINE# assert_equal ( 'string' , json_resp [ 'data' ] [ 'type' ] , json_resp ) #NEWLINE# assert_equal ( 'alter comment' , json_resp [ 'data' ] [ 'comment' ] , json_resp ) #NEWLINE# resp = self . client . post ( reverse ( 'metastore:alter_column' , kwargs = { #NEWLINE# #INDENT# 'database' : self . db_name , #NEWLINE# 'table' : 'test_alter_column' , #NEWLINE# #UNINDENT# } ) , { #NEWLINE# #INDENT# 'column' : 'before_alter' , #NEWLINE# 'new_column_name' : 'foo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# json_resp = json . loads ( resp . content ) #NEWLINE# assert_equal ( 1 , json_resp [ 'status' ] , json_resp ) #NEWLINE# assert_true ( ( 'Failed to alter column' in json_resp [ 'message' ] ) , json_resp )