예제 #1
0
 def test_active_dataset_status(self):
     job = Job.create(self.conn, self.dataset)
     stage = job.get_stage(Stage.INGEST)
     stage.queue({'test': 'foo'}, {})
     stage.queue({'test': 'bar'}, {})
     status = Dataset.get_active_dataset_status(self.conn)
     assert len(status['datasets']) == 1
     assert status['total'] == 1
     assert status['datasets']['test_1']['pending'] == 2
     job.dataset.cancel()
     status = Dataset.get_active_dataset_status(self.conn)
     assert status['datasets'] == {}
     assert status['total'] == 0
예제 #2
0
 def test_active_dataset_status(self):
     job = Job.create(self.conn, self.dataset)
     stage = job.get_stage("ingest")
     stage.queue({"test": "foo"}, {})
     stage.queue({"test": "bar"}, {})
     status = Dataset.get_active_dataset_status(self.conn)
     assert len(status["datasets"]) == 1
     assert status["total"] == 1
     assert status["datasets"]["test_1"]["pending"] == 2
     job.dataset.cancel()
     status = Dataset.get_active_dataset_status(self.conn)
     assert status["datasets"] == {}
     assert status["total"] == 0
예제 #3
0
파일: queues.py 프로젝트: wdsn/aleph
def get_active_collection_status():
    data = Dataset.get_active_dataset_status(kv)
    return data