text: from functools import (partial, wraps)
  
  
  def template(args):
  
      def wrapper(func):
          func.template = args
          return func
  
      return wrapper
  
  
  def method_partial(func, *parameters, **kparms):
      @wraps(func)
      def wrapped(self, *args, **kw):
          kw.update(kparms)
          return func(self, *(args + parameters), **kw)
      return wrapped
  
  
  class TemplateTestCase(type):
  
      def __new__(cls, name, bases, attr):
  
          new_methods = {}
  
          for method_name in attr:
              if hasattr(attr[method_name], "template"):
                  source = attr[method_name]
                  source_name = method_name.lstrip("_")
  
                  for test_name, args in source.template.items():
                      parg, kwargs = args
  
                      new_name = "%s_%s" % (source_name, test_name)
                      new_methods[new_name] = method_partial(
                          source, *parg, **kwargs)
                      new_methods[new_name].__name__ = new_name
  
          attr.update(new_methods)
          return type(name, bases, attr)
  
  
  def Call(*args, **kwargs):
      return (args, kwargs)
  