コード例 #1
0
ファイル: service.py プロジェクト: junaid-ali/rally
    def __init__(self, clients, name_generator=None, atomic_inst=None):
        """Initialize service class

        :param clients: an instance of rally.osclients.Clients
        :param name_generator: a method for generating random names. Usually
            it is generate_random_name method of RandomNameGeneratorMixin
            instance.
        :param atomic_inst: an object to store atomic actions. Usually, it is
            `_atomic_actions` property of ActionTimerMixin instance
        """
        self._clients = clients
        self._name_generator = name_generator

        if atomic_inst is None:
            self._atomic_actions = atomic.ActionTimerMixin().atomic_actions()
        else:
            self._atomic_actions = atomic_inst

        self.version = None
        if self._meta_is_inited(raise_exc=False):
            self.version = self._meta_get("version")
コード例 #2
0
 def test_atomic_actions(self):
     inst = atomic.ActionTimerMixin()
     self.assertEqual(inst._atomic_actions, inst.atomic_actions())