'Delete volume when enable replication.'

@mock.patch.object(helper.DS8KCommonHelper, 'delete_lun_by_id')
@mock.patch.object(helper.DS8KCommonHelper, 'delete_lun')
def test_delete_fb_replicated_volume(self, mock_delete_lun, mock_delete_lun_by_id):

    self.configuration.replication_device = [TEST_REPLICATION_DEVICE]
    self.driver = FakeDS8KProxy(self.storage_info, self.logger, self.exception, self)
    self.driver.setup(self.ctxt)
    extra_spec = {'replication_enabled': '<is>    True'}
    vol_type = volume_types.create(self.ctxt, 'VOL_TYPE', extra_spec)
    location = six.text_type({'vol_hex_id': TEST_VOLUME_ID})
    data = json.dumps({TEST_TARGET_DS8K_IP: {'vol_hex_id': TEST_VOLUME_ID}})
    volume = self._create_volume(volume_type_id=vol_type.id, provider_location=location, replication_driver_data=data)
    self.driver.delete_volume(volume)
    self.assertTrue(mock_delete_lun_by_id.called)
    self.assertTrue(mock_delete_lun.called)
