#NEWLINE# @ mock . patch ( 'nova.db.instance_tag_get_by_instance_uuid' ) #NEWLINE# def test_index( self , mock_db_get_inst_tags ) : #NEWLINE# #INDENT# fake_tags = [ self . _get_tag ( tag ) for tag in TAGS ] #NEWLINE# mock_db_get_inst_tags . return_value = fake_tags #NEWLINE# req = self . _get_request ( ( '/v2/fake/servers/%s/tags' % UUID ) , 'GET' ) #NEWLINE# context = context . environ [ 'nova.context' ] #NEWLINE# res = self . controller . index ( req , UUID ) #NEWLINE# self . assertEqual ( TAGS , res . get ( 'tags' ) ) #NEWLINE# mock_db_get_inst_tags . assert_called_once_with ( context , UUID )