'Test retyping a non replicated volume.
We will test on a system that doesn\'t have replication enabled and on
one that hast it enabled.'

@ddt.data(False, True)
@common_mocks
def test_retype(self, enabled):

    self.driver._is_replication_enabled = enabled
    if enabled:
        expect = {'replication_status': fields.ReplicationStatus.DISABLED}
    else:
        expect = None
    context = {}
    diff = {'encryption': {}, 'extra_specs': {}}
    updates = {'name': 'testvolume', 'host': 'currenthost', 'id': fake.VOLUME_ID}
    fake_type = fake_volume.fake_volume_type_obj(context)
    volume = fake_volume.fake_volume_obj(context, **updates)
    volume.volume_type = None
    host = {'host': 'currenthost'}
    self.assertEqual((True, expect), self.driver.retype(context, volume, fake_type, diff, host))
    diff['encryption'] = {}
    self.assertEqual((True, expect), self.driver.retype(context, volume, fake_type, diff, host))
    diff['extra_specs'] = {'non-empty': 'non-empty'}
    self.assertEqual((True, expect), self.driver.retype(context, volume, fake_type, diff, host))
    diff['extra_specs'] = {}
    self.assertEqual((True, expect), self.driver.retype(context, volume, fake_type, diff, host))
