Esempio n. 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
Esempio n. 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
Esempio n. 3
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
Esempio n. 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