#NEWLINE# def test_drop_partition( self ) : #NEWLINE# #INDENT# partition_spec = "baz='baz_drop',boom='boom_drop'" #NEWLINE# hql = ( 'ALTER TABLE `%s`.`test_partitions` ADD IF NOT EXISTS PARTITION (%s);' % ( self . db_name , partition_spec ) ) #NEWLINE# resp = _make_query ( self . client , hql , database = self . db_name ) #NEWLINE# wait_for_query_to_finish ( self . client , resp , max = 30.0 ) #NEWLINE# response = self . client . get ( ( '/metastore/table/%s/test_partitions/partitions' % self . db_name ) ) #NEWLINE# assert_true ( ( 'baz_drop' in response . content ) ) #NEWLINE# self . client . post ( ( '/metastore/table/%s/test_partitions/partitions/drop' % self . db_name ) , { #NEWLINE# #INDENT# 'partition_selection' : [ partition_spec ] , #NEWLINE# #UNINDENT# } , follow = True ) #NEWLINE# query = QueryHistory . objects . latest ( 'id' ) #NEWLINE# assert_equal_mod_whitespace ( ( 'ALTER TABLE `%s`.`test_partitions` DROP IF EXISTS PARTITION (%s) PURGE' % ( self . db_name , partition_spec ) ) , query . query ) #NEWLINE# response = self . client . get ( ( '/metastore/table/%s/test_partitions/partitions' % self . db_name ) ) #NEWLINE# assert_false ( ( 'baz_drop' in resp . content ) )