Esempio n. 1
0
 def test_process_wgs_master_scaffolds_contig_with_seq(self):
     """Test process_wgs_master_scaffolds() doesn't get contigs if there is a CONTIG ann. but also a sequence"""
     fake_records = [
         FakeRecord(annotations={'contig': 'foo'}),
         FakeRecord(annotations={'contig': 'bar'})
     ]
     procesed = utils.process_wgs_master_scaffolds(fake_records)
     self.assertEqual(fake_records, procesed)
Esempio n. 2
0
    def test_process_wgs_master_scaffolds_wgs_with_seq(self):
        """Test process_wgs_master_scaffolds() doesn't get contigs if there are WGS/WGS_SCAFLDs but also sequences"""
        mock('utils.fix_wgs_master_record',
             tracker=self.tt,
             returns_func=lambda x: [x])
        fake_records = [
            FakeRecord(annotations={'wgs': 'foo'}),
            FakeRecord(annotations={'wgs_scafld': 'bar'})
        ]

        procesed = utils.process_wgs_master_scaffolds(fake_records)
        self.assertEqual(fake_records, procesed)
Esempio n. 3
0
    def test_process_wgs_master_scaffolds_wgs(self):
        """Test process_wgs_master_scaffolds() gets contigs from NCBI if there are WGS/WGS_SCAFLD annotations"""
        mock('utils.fix_wgs_master_record',
             tracker=self.tt,
             returns_func=lambda x: [x])
        fake_records = [
            FakeRecord(annotations={'wgs': 'foo'}),
            FakeRecord(annotations={'wgs_scafld': 'bar'})
        ]
        fake_records[0].seq = UnknownSeq(23)
        fake_records[1].seq = UnknownSeq(42)
        trace = """Called utils.fix_wgs_master_record(
    <antismash.test.test_utils.FakeRecord object at ...>)
Called utils.fix_wgs_master_record(
    <antismash.test.test_utils.FakeRecord object at ...>)
"""
        procesed = utils.process_wgs_master_scaffolds(fake_records)
        self.assertEqual(fake_records, procesed)
        assert_same_trace(self.tt, trace)
Esempio n. 4
0
 def test_process_wgs_master_scaffolds_no_scaffolds(self):
     """Test process_wgs_master_scaffolds() does not change the list of records if there are no scaffolds"""
     fake_records = [FakeRecord(), FakeRecord()]
     procesed = utils.process_wgs_master_scaffolds(fake_records)
     self.assertEqual(fake_records, procesed)