#NEWLINE# def test_attach_foreign_instance_error( self ) : #NEWLINE# #INDENT# '\n        Attempting to attach a volume to a non-local instance will\n        raise an ``AttachUnexpectedInstance`` error.\n        ' #NEWLINE# dataset_id = uuid4 ( ) #NEWLINE# volume = self . api . create_volume ( dataset_id = dataset_id , size = ONE_GIB ) #NEWLINE# self . addCleanup ( self . api . destroy_volume , volume . blockdevice_id ) #NEWLINE# bad_instance_id = 'i-12345678' #NEWLINE# self . assertRaises ( AttachUnexpectedInstance , bad_instance_id . api . attach_volume , volume . blockdevice_id , bad_instance_id )