def test_set_info(self):
        transcript = Transcript(strand='-', start=10000, end=19600)
        transcript.exons = [Exon('1-2'), Exon('3-4'), Exon('5-6')]
        transcript.cdna_length = 8100
        transcript.prot_length = 1200

        transcript.set_info()
        assert transcript.info == '-/9.6kb/3/8.1kb/1200'
    def test_finalize(self):

        transcript = Transcript(strand='+', coding_start=16, coding_end=53)
        transcript.exons = [Exon('10-20'), Exon('30-40'), Exon('50-60')]
        transcript.finalize()
        assert transcript.cdna_length == 30
        assert transcript.prot_length == 5
        assert transcript.start == 10
        assert transcript.end == 60

        transcript = Transcript(strand='-', coding_start=55, coding_end=15)
        transcript.exons = [Exon('50-60'), Exon('30-40'), Exon('10-20')]
        transcript.finalize()
        assert transcript.cdna_length == 30
        assert transcript.prot_length == 6
        assert transcript.start == 10
        assert transcript.end == 60
    def test_add(self):
        transcript = Transcript(id='xyz',
                                chrom='11',
                                strand='+',
                                start=130,
                                end=580)
        transcript.exons = [Exon('100-200'), Exon('300-400'), Exon('500-600')]
        self.tdb_writer.add(transcript)

        assert self.tdb_writer._records['11'][0] == [
            'xyz', '11', '100-200,300-400,500-600', 130, 580
        ]