示例#1
0
 def wrapper(func):
     plugin.from_func(Scenario)(func)
     func._meta_init()
     if name:
         func._set_name_and_namespace(name, namespace)
     else:
         func._meta_set("namespace", namespace)
     func._meta_set("default_context", context or {})
     return func
示例#2
0
 def wrapper(func):
     plugin.from_func(Scenario)(func)
     func._meta_init()
     if name:
         func._set_name_and_namespace(name, namespace)
     else:
         func._meta_set("namespace", namespace)
     func._meta_set("default_context", context or {})
     return func
示例#3
0
文件: scenario.py 项目: gluke77/rally
 def wrapper(scen):
     scen.is_classbased = hasattr(scen, "run") and callable(scen.run)
     if not scen.is_classbased:
         plugin.from_func(Scenario)(scen)
     scen._meta_init()
     if name:
         if "." not in name.strip("."):
             msg = (_("Scenario name must include a dot: '%s'") % name)
             raise exceptions.RallyException(msg)
         scen._set_name_and_namespace(name, namespace)
     else:
         scen._meta_set("namespace", namespace)
     scen._meta_set("default_context", context or {})
     return scen
示例#4
0
 def wrapper(scen):
     scen.is_classbased = hasattr(scen, "run") and callable(scen.run)
     if not scen.is_classbased:
         plugin.from_func(Scenario)(scen)
     scen._meta_init()
     if name:
         if "." not in name.strip("."):
             msg = (_("Scenario name must include a dot: '%s'") % name)
             raise exceptions.RallyException(msg)
         scen._set_name_and_namespace(name, namespace)
     else:
         scen._meta_set("namespace", namespace)
     scen._meta_set("default_context", context or {})
     return scen