def test_attach_foreign_instance_error(self):
        dataset_id = uuid4()
        volume = self.api.create_volume(dataset_id=dataset_id, size=ONE_GIB)

        self.addCleanup(self.api.destroy_volume, volume.blockdevice_id)

        bad_instance_id = u'i-12345678'

        self.assertRaises(
            AttachUnexpectedInstance,
            self.api.attach_volume,
            volume.blockdevice_id,
            bad_instance_id
        )
Attempting to attach a volume to a non-local instance will
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/functional/test_ebs.py/EBSBlockDeviceAPIInterfaceTests.test_attach_foreign_instance_error