Browse Source

Tests passing

Ask Solem 10 years ago
parent
commit
6be5fc64ef
2 changed files with 4 additions and 35 deletions
  1. 2 20
      celery/tests/concurrency/test_eventlet.py
  2. 2 15
      celery/tests/concurrency/test_gevent.py

+ 2 - 20
celery/tests/concurrency/test_eventlet.py

@@ -5,7 +5,6 @@ import sys
 from celery.app.defaults import is_pypy
 from celery.concurrency.eventlet import (
     apply_target,
-    Schedule,
     Timer,
     TaskPool,
 )
@@ -54,14 +53,14 @@ eventlet_modules = (
 )
 
 
-class test_Schedule(EventletCase):
+class test_Timer(EventletCase):
 
     def test_sched(self):
         with mock_module(*eventlet_modules):
             with patch_many('eventlet.greenthread.spawn_after',
                             'greenlet.GreenletExit') as (spawn_after,
                                                          GreenletExit):
-                x = Schedule()
+                x = Timer()
                 x.GreenletExit = KeyError
                 entry = Mock()
                 g = x._enter(1, 0, entry)
@@ -99,20 +98,3 @@ class test_TaskPool(EventletCase):
     def test_apply_target(self, base):
         apply_target(Mock(), getpid=Mock())
         self.assertTrue(base.apply_target.called)
-
-
-class test_Timer(EventletCase):
-
-    def test_timer(self):
-        x = Timer()
-        x.ensure_started()
-        x.schedule = Mock()
-        x.start()
-        x.stop()
-        x.schedule.clear.assert_called_with()
-
-        tref = Mock()
-        x.cancel(tref)
-        x.schedule.GreenletExit = KeyError
-        tref.cancel.side_effect = KeyError()
-        x.cancel(tref)

+ 2 - 15
celery/tests/concurrency/test_gevent.py

@@ -1,7 +1,6 @@
 from __future__ import absolute_import
 
 from celery.concurrency.gevent import (
-    Schedule,
     Timer,
     TaskPool,
     apply_timeout,
@@ -43,7 +42,7 @@ class test_gevent_patch(GeventCase):
                 self.assertTrue(patch_all.called)
 
 
-class test_Schedule(AppCase):
+class test_Timer(AppCase):
 
     def test_sched(self):
         with mock_module(*gevent_modules):
@@ -51,7 +50,7 @@ class test_Schedule(AppCase):
                             'gevent.greenlet.GreenletExit') as (greenlet,
                                                                 GreenletExit):
                 greenlet.Greenlet = object
-                x = Schedule()
+                x = Timer()
                 greenlet.Greenlet = Mock()
                 x._Greenlet.spawn_later = Mock()
                 x._GreenletExit = KeyError
@@ -100,18 +99,6 @@ class test_TaskPool(AppCase):
                 self.assertEqual(x.num_processes, 3)
 
 
-class test_Timer(AppCase):
-
-    def test_timer(self):
-        with mock_module(*gevent_modules):
-            x = Timer()
-            x.ensure_started()
-            x.schedule = Mock()
-            x.start()
-            x.stop()
-            x.schedule.clear.assert_called_with()
-
-
 class test_apply_timeout(AppCase):
 
     def test_apply_timeout(self):