def test_levels(self): """ Include the task level in the task name. """ self.assertThat( task_name(nested_action_task), Equals(u'app:action:nest@1,1/started'))
def test_none(self): """ Cannot create a task name for ``None``. """ self.assertThat( lambda: task_name(None), raises(ValueError))
def test_levels(self): """ Include the task level in the task name. """ self.assertThat( task_name(nested_action_task), Equals(u'app:action:nested@1,1/started'))
def test_no_action_type(self): """ If the task does not include either a ``message_type`` or an ``action_type`` key, then return None. """ self.assertThat( task_name(unnamed_message), Is(None))
def test_no_message_type(self): """ If the task does not include a ``message_type`` key use the ``action_type`` and ``action_status`` keys to construct a name. """ self.assertThat( task_name(action_task), Equals(u'app:action@1/started'))
def test_message_type(self): """ If the task includes a ``message_type`` key use it to construct the name. """ self.assertThat( task_name(message_task), Equals(u'twisted:log@1'))