async def setUpAsync(self): await super().setUpAsync() self.job_id_01 = str(uuid.uuid4()) self.job_id_02 = str(uuid.uuid4()) self.job_id_03 = str(uuid.uuid4()) self.date_01 = datetime.datetime.now() self.date_02 = datetime.datetime.now() - datetime.timedelta(days=2) self.date_03 = datetime.datetime.now() - datetime.timedelta(days=8) async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id_01, query='', submitted=self.date_01, status=JOB_STATUS_CHOICES.started)) await connection.execute(Job.insert().values( id=self.job_id_02, query='', submitted=self.date_02, status=JOB_STATUS_CHOICES.started)) await connection.execute(Job.insert().values( id=self.job_id_03, query='', submitted=self.date_03, status=JOB_STATUS_CHOICES.started))
async def setUpAsync(self): await super().setUpAsync() async with self.app['engine'].acquire() as connection: self.consumer_ip = get_ip(self.app) self.consumer_port = '8000' await connection.execute(Consumer.insert().values( ip=self.consumer_ip, status='avaiable', port=self.consumer_port)) self.job_id = str(uuid.uuid4()) await connection.execute(Job.insert().values( id=self.job_id, query='AACAGCATGAGTGCGCTGGATGCTG', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) self.job_chunk_id = await connection.scalar( JobChunk.insert().values( job_id=self.job_id, database='mirbase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.started, consumer=self.consumer_ip))
async def setUpAsync(self): await super().setUpAsync() self.job_id = str(uuid.uuid4()) async with self.app['engine'].acquire() as connection: await connection.execute( Job.insert().values( id=self.job_id, query='AACAGCATGAGTGCGCTGGATGCTG', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started ) ) await connection.execute( Consumer.insert().values(ip='192.168.0.2', status=CONSUMER_STATUS_CHOICES.busy) ) self.job_chunk_id = await connection.scalar( JobChunk.insert().values( job_id=self.job_id, database='mirbase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending, consumer='192.168.0.2' ) )
async def test_job_priority(self): job_id3 = str(uuid.uuid4()) async with self.app['engine'].acquire() as connection: await connection.execute( Job.insert().values( id=job_id3, query='GGACGGAGGCGCGCCCGAGAUGAGUAG', submitted=datetime.datetime.now(), priority='high', status=JOB_STATUS_CHOICES.started ) ) await connection.scalar( JobChunk.insert().values( job_id=job_id3, database='rfam', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending ) ) chunks = await find_highest_priority_jobs(self.app['engine']) assert len(chunks) == 3 job_id, priority, submitted, database = chunks[0] assert job_id == job_id3 assert database == 'rfam'
async def setUpAsync(self): await super().setUpAsync() self.job_id = str(uuid.uuid4()) self.job_id2 = str(uuid.uuid4()) async with self.app['engine'].acquire() as connection: await connection.execute( Job.insert().values( id=self.job_id, query='AACAGCATGAGTGCGCTGGATGCTG', submitted=datetime.datetime.now(), priority='low', status=JOB_STATUS_CHOICES.started ) ) await connection.execute( Job.insert().values( id=self.job_id2, query='CGTGCTGAATAGCTGGAGAGGCTCAT', submitted=datetime.datetime.now(), priority='low', status=JOB_STATUS_CHOICES.started ) ) self.job_chunk_id1 = await connection.scalar( JobChunk.insert().values( job_id=self.job_id, database='mirbase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending ) ) self.job_chunk_id2 = await connection.scalar( JobChunk.insert().values( job_id=self.job_id2, database='pombase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending ) )
async def setUpAsync(self): await super().setUpAsync() async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query='AACAGCATGAGTGCGCTGGATGCTG', description='', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started))
async def setUpAsync(self): await super().setUpAsync() self.job_id = str(uuid.uuid4()) async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query='', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started))
async def setUpAsync(self): await super().setUpAsync() consumer_ip = get_ip(self.app) async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query='AACAGCATGAGTGCGCTGGATGCTG', description='CATE_ECOLI', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) async with self.app['engine'].acquire() as connection: await connection.execute(Consumer.insert().values( ip=consumer_ip, status='avaiable', port='8000'))
async def setUpAsync(self): await super().setUpAsync() self.consumer_ip = get_ip(self.app) async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query= 'AGUUACGGCCAUACCUCAGAGAAUAUACCGUAUCCCGUUCGAUCUGCGAAGUUAAGCUCUGAAGGGCGUCGUCAGUACUAUAGUGGGUGACCAUAUGGGAAUACGACGUGCUGUAGCUU', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) async with self.app['engine'].acquire() as connection: await connection.execute(InfernalJob.insert().values( job_id=self.job_id, ))
async def setUpAsync(self): await super().setUpAsync() async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query= 'CACGGUGGGGGCGCGCCGGUCUCCCGGAGCGGGACCGGGUCGGAGGAUGGACGAGAAUCAC', description='testing', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) self.infernal_job_id = await connection.scalar( InfernalJob.insert().values( job_id=self.job_id, submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending))
async def setUpAsync(self): await super().setUpAsync() self.job_id = str(uuid.uuid4()) async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query='', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) self.job_chunk_id1 = await connection.scalar( JobChunk.insert().values( job_id=self.job_id, database='mirbase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.started)) await connection.scalar(JobChunk.insert().values( job_id=self.job_id, database='pombase', submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.started)) await connection.scalar(JobChunkResult.insert().values( job_chunk_id=self.job_chunk_id1, rnacentral_id='URS000075D2D2_10090', description='Mus musculus miR - 1195 stem - loop', score=6.5, bias=0.7, e_value=32, target_length=98, alignment= "Query 8 GAGUUUGAGACCAGCCUGGCCA 29\n| | | | | | | | | | | | | | | | | |\nSbjct_10090\n22\nGAGUUCGAGGCCAGCCUGCUCA\n43", alignment_length=22, gap_count=0, match_count=18, nts_count1=22, nts_count2=0, identity=81.81818181818183, query_coverage=73.33333333333333, target_coverage=0, gaps=0, query_length=30, result_id=1))
async def setUpAsync(self): await super().setUpAsync() async with self.app['engine'].acquire() as connection: await connection.execute(Job.insert().values( id=self.job_id, query= 'CACGGUGGGGGCGCGCCGGUCUCCCGGAGCGGGACCGGGUCGGAGGAUGGACGAGAAUCAC', description='testing', submitted=datetime.datetime.now(), status=JOB_STATUS_CHOICES.started)) self.infernal_job_id = await connection.scalar( InfernalJob.insert().values( job_id=self.job_id, submitted=datetime.datetime.now(), status=JOB_CHUNK_STATUS_CHOICES.pending)) self.results = [{ 'target_name': 'SSU_rRNA_eukarya', 'accession_rfam': 'RF01960', 'query_name': 'query', 'accession_seq': '-', 'mdl': 'cm', 'mdl_from': 1, 'mdl_to': 609, 'seq_from': 1764, 'seq_to': 2417, 'strand': '+', 'trunc': "3'", 'pipeline_pass': 3, 'gc': 0.56, 'bias': 0.0, 'score': 559.2, 'e_value': 4.6e-167, 'inc': '!', 'description': 'Eukaryotic small subunit ribosomal RNA', 'alignment': '' }]