@@ -0,0 +1,1275 @@
+import dendrogenous as dg%0Aimport dendrogenous.utils%0A%0Afrom Bio import SeqRecord%0Afrom Bio.Seq import Seq%0Afrom Bio.SeqRecord import SeqRecord%0Afrom Bio.Alphabet import IUPAC%0A%0Afrom dendrogenous.test.base import BaseTestCase%0A%0Aclass TestReformatAccession(BaseTestCase):%0A%0A    def test_reformat_accession_method_for_too_long_accessions(self):%0A        %22%22%22%0A        Test reformat accession works as expected%0A        %22%22%22%0A        too_long = SeqRecord(%5C%0A                   Seq(%22X%22,%0A                   IUPAC.protein),%0A                   id=%22012345678901234567890123456789%22,%0A                   name=%22foo%22,%0A                   description=%22bar, baz%22)%0A%0A        truncated = dg.utils.reformat_accession(too_long)%0A%0A        self.assertEqual(len(truncated.id), 20)%0A        self.assertEqual(truncated.id, %2201234567890123456789%22)%0A%0A    def test_reformat_accession_method_for_problematic_characters(self):%0A        %22%22%22%0A        Test reformat accession works as expected%0A        %22%22%22%0A        bad_char = SeqRecord(%5C%0A                   Seq(%22X%22,%0A                   IUPAC.protein),%0A                   id=%22%7Cblah,%7Ct:()%22,%0A                   name=%22foo%22,%0A                   description=%22bar, baz%22)%0A%0A        fixed_chars = dg.utils.reformat_accession(bad_char)%0A        self.assertEqual(fixed_chars.id, %22_blah__t___%22)%0A%0A%0A

Add unit tests for reformatting accession id