|
@@ -62,7 +62,7 @@ class EventSubscriptionNotificationTests(unittest.TestCase):
|
|
|
events.callbacks[:] = [(DummyEvent, callback)]
|
|
|
events.notify(ASubclassEvent())
|
|
|
self.assertEqual(L, [1])
|
|
|
-
|
|
|
+
|
|
|
|
|
|
class TestEventTypes(unittest.TestCase):
|
|
|
def test_ProcessLogEvent_attributes(self):
|
|
@@ -135,10 +135,10 @@ class TestEventTypes(unittest.TestCase):
|
|
|
from supervisor.events import ProcessCommunicationStdoutEvent
|
|
|
from supervisor.events import ProcessCommunicationEvent
|
|
|
self.assertTrue(
|
|
|
- issubclass(ProcessCommunicationStdoutEvent,
|
|
|
+ issubclass(ProcessCommunicationStdoutEvent,
|
|
|
ProcessCommunicationEvent)
|
|
|
)
|
|
|
-
|
|
|
+
|
|
|
def test_ProcessCommunicationStderrEvent_attributes(self):
|
|
|
from supervisor.events import ProcessCommunicationStderrEvent
|
|
|
inst = ProcessCommunicationStderrEvent(1, 2, 3)
|
|
@@ -151,7 +151,7 @@ class TestEventTypes(unittest.TestCase):
|
|
|
from supervisor.events import ProcessCommunicationStderrEvent
|
|
|
from supervisor.events import ProcessCommunicationEvent
|
|
|
self.assertTrue(
|
|
|
- issubclass(ProcessCommunicationStderrEvent,
|
|
|
+ issubclass(ProcessCommunicationStderrEvent,
|
|
|
ProcessCommunicationEvent)
|
|
|
)
|
|
|
|
|
@@ -190,7 +190,7 @@ class TestEventTypes(unittest.TestCase):
|
|
|
for klass in (
|
|
|
events.SupervisorStateChangeEvent,
|
|
|
events.SupervisorRunningEvent,
|
|
|
- events.SupervisorStoppingEvent
|
|
|
+ events.SupervisorStoppingEvent
|
|
|
):
|
|
|
self._test_one_SupervisorStateChangeEvent(klass)
|
|
|
|
|
@@ -238,7 +238,7 @@ class TestEventTypes(unittest.TestCase):
|
|
|
def _test_one_TickEvent(self, klass):
|
|
|
from supervisor.events import TickEvent
|
|
|
self.assertTrue(issubclass(klass, TickEvent))
|
|
|
-
|
|
|
+
|
|
|
inst = klass(1, 2)
|
|
|
self.assertEqual(inst.when, 1)
|
|
|
self.assertEqual(inst.supervisord, 2)
|
|
@@ -252,7 +252,7 @@ class TestEventTypes(unittest.TestCase):
|
|
|
from supervisor.events import ProcessGroupRemovedEvent
|
|
|
inst = ProcessGroupRemovedEvent('myprocess')
|
|
|
self.assertEqual(inst.group, 'myprocess')
|
|
|
-
|
|
|
+
|
|
|
class TestSerializations(unittest.TestCase):
|
|
|
def _deserialize(self, serialization):
|
|
|
data = serialization.split('\n')
|
|
@@ -299,7 +299,7 @@ class TestSerializations(unittest.TestCase):
|
|
|
self.assertEqual(headers['groupname'], 'process1', headers)
|
|
|
self.assertEqual(headers['pid'], '1', headers)
|
|
|
self.assertEqual(payload, 'yo')
|
|
|
-
|
|
|
+
|
|
|
def test_pcomm_stdout_event(self):
|
|
|
options = DummyOptions()
|
|
|
pconfig1 = DummyPConfig(options, 'process1', 'process1','/bin/process1')
|
|
@@ -314,7 +314,7 @@ class TestSerializations(unittest.TestCase):
|
|
|
self.assertEqual(headers['groupname'], 'process1', headers)
|
|
|
self.assertEqual(headers['pid'], '1', headers)
|
|
|
self.assertEqual(payload, 'yo')
|
|
|
-
|
|
|
+
|
|
|
def test_pcomm_stderr_event(self):
|
|
|
options = DummyOptions()
|
|
|
pconfig1 = DummyPConfig(options, 'process1', 'process1','/bin/process1')
|
|
@@ -428,7 +428,7 @@ class TestSerializations(unittest.TestCase):
|
|
|
event = klass(process1, ProcessStates.STARTING)
|
|
|
headers, payload = self._deserialize(str(event))
|
|
|
self.assertEqual(headers['tries'], '2')
|
|
|
-
|
|
|
+
|
|
|
def test_process_state_exited_event_expected(self):
|
|
|
from supervisor import events
|
|
|
from supervisor.states import ProcessStates
|