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
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
def get_active_collection_status(): data = Dataset.get_active_dataset_status(kv) return data