Ejemplo n.º 1
0
 def test_admin_queue_status_widget_contains_queue_names(self):
     from signalqueue.worker import queues
     post_out = self.client.post('/admin/', dict(
         username=self.user.username, password=self.testpass, this_is_the_login_form='1', next='/admin/'))
     admin_root_page = self.client.get('/admin/')
     for queue_name in queues.keys():
         self.assertContains(admin_root_page, queue_name.capitalize())
         self.assertTrue(queue_name.capitalize() in admin_root_page.content)
     self.client.get('/admin/logout/')
Ejemplo n.º 2
0
 def test_worker_status_url_with_queue_parameter_content(self):
     from signalqueue.worker import queues
     for queue_name in queues.keys():
         #if queue_name is not 'celery':
         cnt = queues[queue_name].count() or 0
         self.http_client.fetch(
             self.get_url('/status?queue=%s' % queue_name), self.stop)
         response = self.wait()
         self.assertTrue(queue_name in response.body)
         self.assertTrue("enqueued" in response.body)
Ejemplo n.º 3
0
 def test_worker_status_url_with_queue_parameter_content(self):
     from signalqueue.worker import queues
     for queue_name in queues.keys():
         self.http_client.fetch(self.get_url('/status?queue=%s' % queue_name), self.stop)
         response = self.wait()
         self.assertTrue(queue_name in response.body)
         self.assertTrue("enqueued" in response.body)
         
         phrase = "%s enqueued signals" % queues[queue_name].count()
         self.assertTrue(phrase in response.body)
Ejemplo n.º 4
0
 def queue(self, queue_name=None):
     if queue_name is None:
         queue_name = self.application.queue_name
     if queue_name not in queues.keys():
         raise IndexError("No queue named %s is defined" % queue_name)
     
     if not queue_name in self.application.queues:
         self.application.queues[queue_name] = PoolQueue(queue_name=queue_name, active=False)
     
     return self.application.queues[queue_name]
Ejemplo n.º 5
0
    def queue(self, queue_name=None):
        if queue_name is None:
            queue_name = self.application.queue_name
        if queue_name not in queues.keys():
            raise IndexError("No queue named %s is defined" % queue_name)

        if not queue_name in self.application.queues:
            self.application.queues[queue_name] = PoolQueue(
                queue_name=queue_name, active=False)

        return self.application.queues[queue_name]
Ejemplo n.º 6
0
    def test_admin_queue_status_widget_contains_queue_names(self):
        from signalqueue.worker import queues

        post_out = self.client.post(
            "/admin/",
            dict(username=self.user.username, password=self.testpass, this_is_the_login_form="1", next="/admin/"),
        )
        admin_root_page = self.client.get("/admin/")
        for queue_name in queues.keys():
            self.assertContains(admin_root_page, queue_name.capitalize())
            self.assertTrue(queue_name.capitalize() in admin_root_page.content)
        self.client.get("/admin/logout/")
        print post_out  # pyflakes don't crack
Ejemplo n.º 7
0
 def test_admin_queue_status_widget_contains_queue_names(self):
     from signalqueue.worker import queues
     post_out = self.client.post(
         '/admin/',
         dict(username=self.user.username,
              password=self.testpass,
              this_is_the_login_form='1',
              next='/admin/'))
     admin_root_page = self.client.get('/admin/')
     for queue_name in queues.keys():
         self.assertContains(admin_root_page, queue_name.capitalize())
         self.assertTrue(queue_name.capitalize() in admin_root_page.content)
     self.client.get('/admin/logout/')
     print post_out  # pyflakes don't crack