def test_extract_region(): test_seqs = [ ('AAAABBBBCCCC', (0, 12), (0, 12), 'AAAABBBBCCCC'), ('AAAABBBBCCCC', (0, 12), (4, 8), 'BBBB'), ('AAAABBBBCCCC', (4, 16), (3, 7), '-AAA'), ('AAAABBBBCCCC', (4, 16), (0, 4), '----'), ('AAAABBBBCCCC', (4, 16), (14, 18), 'CC--'), ] for found_seq, (fs, fe), (rs, re), cor in test_seqs: out = HIVTransTool.extract_region(found_seq, fs, fe, rs, re) eq_(out, cor, '(%i, %i), (%i, %i)' % (fs, fe, rs, re))