コード例 #1
0
 def test_survives_unknown_task_event(self):
     s = State()
     s.task_event("task-unknown-event-xxx", {
         "foo": "bar",
         "uuid": "x",
         "hostname": "y"
     })
コード例 #2
0
 def test_survives_unknown_task_event(self):
     s = State()
     s.task_event('task-unknown-event-xxx', {
         'foo': 'bar',
         'uuid': 'x',
         'hostname': 'y'
     })
コード例 #3
0
ファイル: test_state.py プロジェクト: noamgal/celery
    def test_limits_maxtasks(self):
        s = State()
        s.max_tasks_in_memory = 1
        s.task_event("task-unknown-event-xxx", {"foo": "bar", "uuid": "x", "hostname": "y", "clock": 3})
        s.task_event("task-unknown-event-xxx", {"foo": "bar", "uuid": "y", "hostname": "y", "clock": 4})

        s.task_event("task-unknown-event-xxx", {"foo": "bar", "uuid": "z", "hostname": "y", "clock": 5})
        self.assertEqual(len(s._taskheap), 2)
        self.assertEqual(s._taskheap[0].clock, 4)
        self.assertEqual(s._taskheap[1].clock, 5)

        s._taskheap.append(s._taskheap[0])
        self.assertTrue(list(s.tasks_by_time()))
コード例 #4
0
    def test_limits_maxtasks(self):
        s = State()
        s.max_tasks_in_memory = 1
        s.task_event('task-unknown-event-xxx', {
            'foo': 'bar',
            'uuid': 'x',
            'hostname': 'y',
            'clock': 3
        })
        s.task_event('task-unknown-event-xxx', {
            'foo': 'bar',
            'uuid': 'y',
            'hostname': 'y',
            'clock': 4
        })

        s.task_event('task-unknown-event-xxx', {
            'foo': 'bar',
            'uuid': 'z',
            'hostname': 'y',
            'clock': 5
        })
        self.assertEqual(len(s._taskheap), 2)
        self.assertEqual(s._taskheap[0].clock, 4)
        self.assertEqual(s._taskheap[1].clock, 5)

        s._taskheap.append(s._taskheap[0])
        self.assertTrue(list(s.tasks_by_time()))
コード例 #5
0
ファイル: test_state.py プロジェクト: bantha/celery
    def test_limits_maxtasks(self):
        s = State()
        s.max_tasks_in_memory = 1
        s.task_event('task-unknown-event-xxx', {'foo': 'bar',
                                                'uuid': 'x',
                                                'hostname': 'y',
                                                'clock': 3})
        s.task_event('task-unknown-event-xxx', {'foo': 'bar',
                                                'uuid': 'y',
                                                'hostname': 'y',
                                                'clock': 4})

        s.task_event('task-unknown-event-xxx', {'foo': 'bar',
                                                'uuid': 'z',
                                                'hostname': 'y',
                                                'clock': 5})
        self.assertEqual(len(s._taskheap), 2)
        self.assertEqual(s._taskheap[0].clock, 4)
        self.assertEqual(s._taskheap[1].clock, 5)

        s._taskheap.append(s._taskheap[0])
        self.assertTrue(list(s.tasks_by_time()))
コード例 #6
0
ファイル: test_events_state.py プロジェクト: vkryachko/celery
 def test_survives_unknown_task_event(self):
     s = State()
     s.task_event("task-unknown-event-xxx", {"foo": "bar",
                                             "uuid": "x",
                                             "hostname": "y"})
コード例 #7
0
ファイル: test_state.py プロジェクト: Crowdbooster/celery
 def test_survives_unknown_task_event(self):
     s = State()
     s.task_event('task-unknown-event-xxx', {'foo': 'bar',
                                             'uuid': 'x',
                                             'hostname': 'y'})