def test_trim_fasta(self): infasta = StringIO(test_fasta) # Trim length 10 expected = (">seq1\n" "0123456789\n" ">seq2\n" "0123456789\n" ">seq3\n" "012345\n") outfasta = StringIO() trim_fasta(infasta, outfasta, 10) outfasta.seek(0) self.assertEqual(expected, outfasta.read())