def METHOD_NAME(self):
    with patch.object(self.c.plugin, 'create_charm') as create_charm, \
            patch.object(self.c, '_cleanup') as _cleanup:
        create_charm.side_effect = Exception
        with self.assertRaises(Exception):
            self.c.create_charm()
            self.assertTrue(_cleanup.called)