'Test retype.'

def test_retype(self):

    replica_status = self.driver._get_replica_status('test')
    self.assertTrue(replica_status)
    replica = self.driver._get_is_replica(self.vol.volume_type)
    self.assertFalse(replica)
    self.driver.replica = Replication()
    result = self.driver._add_replication(self.vol)
    self.assertIsNone(result)
    self.driver.target = FakeKrest()
    self.driver._check_for_status = mock.Mock()
    result = self.driver._delete_replication(self.vol)
    self.assertIsNone(result)
    self.driver._delete_volume_replica = mock.Mock()
    result = self.driver.retype(None, self.vol, self.vol.volume_type, None, None)
    self.assertTrue(result)
    new_vol_type = fake_volume.fake_volume_type_obj(self.context)
    new_vol_type.extra_specs = {'kaminario:thin_prov_type': 'nodedup'}
    result2 = self.driver.retype(None, self.vol, new_vol_type, None, None)
    self.assertFalse(result2)
