1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 """ Scenario base class
13 import yardstick.common.utils as utils
16 class Scenario(object):
22 def get(scenario_type):
23 """Returns instance of a scenario runner for execution type.
25 for scenario in utils.itersubclasses(Scenario):
26 if scenario_type == scenario.__scenario_type__:
27 return scenario.__module__ + "." + scenario.__name__
29 raise RuntimeError("No such scenario type %s" % scenario_type)