Ejemplo n.º 1
0
 def test_missing_dburi_raises_ImproperlyConfigured(self):
     self.app.conf.database_url = None
     with pytest.raises(ImproperlyConfigured):
         DatabaseBackend(app=self.app)
Ejemplo n.º 2
0
 def test_process_cleanup(self):
     tb = DatabaseBackend(self.uri, app=self.app)
     tb.process_cleanup()
Ejemplo n.º 3
0
 def test_reduce(self):
     tb = DatabaseBackend(self.uri, app=self.app)
     assert loads(dumps(tb))
Ejemplo n.º 4
0
 def test_mark_as_started(self):
     tb = DatabaseBackend(self.uri, app=self.app)
     tid = uuid()
     tb.mark_as_started(tid)
     assert tb.get_state(tid) == states.STARTED
Ejemplo n.º 5
0
 def test_mark_as_revoked(self):
     tb = DatabaseBackend(self.uri, app=self.app)
     tid = uuid()
     tb.mark_as_revoked(tid)
     assert tb.get_state(tid) == states.REVOKED
 def test_process_cleanup(self):
     tb = DatabaseBackend()
     tb.process_cleanup()
Ejemplo n.º 7
0
 def test_missing_task_id_is_PENDING(self):
     tb = DatabaseBackend(self.uri, app=self.app)
     assert tb.get_state('xxx-does-not-exist') == states.PENDING
 def test_mark_as_started(self):
     tb = DatabaseBackend()
     tid = gen_unique_id()
     tb.mark_as_started(tid)
     self.assertEqual(tb.get_status(tid), states.STARTED)
 def test_mark_as_revoked(self):
     tb = DatabaseBackend()
     tid = gen_unique_id()
     tb.mark_as_revoked(tid)
     self.assertEqual(tb.get_status(tid), states.REVOKED)
 def test_missing_task_id_is_PENDING(self):
     tb = DatabaseBackend()
     self.assertEqual(tb.get_status("xxx-does-not-exist"), states.PENDING)
Ejemplo n.º 11
0
 def test_missing_dburi_raises_ImproperlyConfigured(self):
     self.app.conf.sqlalchemy_dburi = None
     with self.assertRaises(ImproperlyConfigured):
         DatabaseBackend(app=self.app)
Ejemplo n.º 12
0
 def test_reduce(self):
     tb = DatabaseBackend(app=self.app)
     self.assertTrue(loads(dumps(tb)))
Ejemplo n.º 13
0
 def test_mark_as_revoked(self):
     tb = DatabaseBackend(app=self.app)
     tid = uuid()
     tb.mark_as_revoked(tid)
     self.assertEqual(tb.get_status(tid), states.REVOKED)
Ejemplo n.º 14
0
 def test_mark_as_started(self):
     tb = DatabaseBackend(app=self.app)
     tid = uuid()
     tb.mark_as_started(tid)
     self.assertEqual(tb.get_status(tid), states.STARTED)