示例#1
0
 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'))
示例#2
0
 def test_none(self):
     """
     Cannot create a task name for ``None``.
     """
     self.assertThat(
         lambda: task_name(None),
         raises(ValueError))
示例#3
0
 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'))
示例#4
0
 def test_none(self):
     """
     Cannot create a task name for ``None``.
     """
     self.assertThat(
         lambda: task_name(None),
         raises(ValueError))
示例#5
0
 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))
示例#6
0
 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'))
示例#7
0
 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'))
示例#8
0
 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))
示例#9
0
 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'))
示例#10
0
 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'))