#NEWLINE# @ mock . patch ( 'nova.db.instance_tag_set' ) #NEWLINE# def test_update_all( self , mock_db_set_inst_tags ) : #NEWLINE# #INDENT# fake_tags = [ self . _get_tag ( tag ) for tag in TAGS ] #NEWLINE# mock_db_set_inst_tags . return_value = fake_tags #NEWLINE# req = self . _get_request ( ( '/v2/fake/servers/%s/tags' % UUID ) , 'PUT' ) #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# res = self . controller . update_all ( req , UUID , body = { #NEWLINE# #INDENT# 'tags' : TAGS , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( TAGS , res [ 'tags' ] ) #NEWLINE# mock_db_set_inst_tags . assert_called_once_with ( context , UUID , TAGS )