mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 18:21:14 +00:00
commit
4015e1e595
@ -1,4 +1,4 @@
|
|||||||
from wa.framework import pluginloader, log, signal
|
from wa.framework import pluginloader, signal
|
||||||
from wa.framework.command import Command, ComplexCommand, SubCommand
|
from wa.framework.command import Command, ComplexCommand, SubCommand
|
||||||
from wa.framework.configuration import settings
|
from wa.framework.configuration import settings
|
||||||
from wa.framework.configuration.core import Status
|
from wa.framework.configuration.core import Status
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
from mock import Mock
|
|
||||||
from nose.tools import assert_true
|
|
||||||
|
|
||||||
from wa.framework import signal
|
|
||||||
from wa.framework.plugin import Plugin
|
|
||||||
from wa.utils.types import identifier
|
|
||||||
|
|
||||||
|
|
||||||
class SignalWatcher(object):
|
|
||||||
|
|
||||||
signals = []
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
for sig in self.signals:
|
|
||||||
name = identifier(sig.name)
|
|
||||||
callback = Mock()
|
|
||||||
callback.im_func.__name__ = name
|
|
||||||
setattr(self, name, callback)
|
|
||||||
signal.connect(getattr(self, name), sig)
|
|
||||||
|
|
||||||
def assert_all_called(self):
|
|
||||||
for m in self.__dict__.itervalues():
|
|
||||||
assert_true(m.called)
|
|
||||||
|
|
||||||
|
|
||||||
class MockContainerActor(Plugin):
|
|
||||||
|
|
||||||
name = 'mock-container'
|
|
||||||
kind = 'container-actor'
|
|
||||||
|
|
||||||
def __init__(self, owner=None, *args, **kwargs):
|
|
||||||
super(MockContainerActor, self).__init__(*args, **kwargs)
|
|
||||||
self.owner=owner
|
|
||||||
self.initialize = Mock()
|
|
||||||
self.finalize = Mock()
|
|
||||||
self.enter = Mock()
|
|
||||||
self.exit = Mock()
|
|
||||||
self.job_started = Mock()
|
|
||||||
self.job_completed = Mock()
|
|
Loading…
x
Reference in New Issue
Block a user