Skip to content
Browse files

Start unittest-based SeqIO GenBank/EMBL testing

  • Loading branch information...
1 parent 606ea93 commit 680354c6f3646075a5e95615d02dca94fbc3b5cd @peterjc peterjc committed Mar 12, 2013
Showing with 30 additions and 1 deletion.
  1. +1 −1 Tests/EMBL/DD231055_edited.embl
  2. +29 −0 Tests/test_SeqIO_Insdc.py
View
2 Tests/EMBL/DD231055_edited.embl
@@ -7,7 +7,7 @@ DT 31-AUG-2006 (Rel. 89, Last updated, Version 2)
XX
DE RSV PROTEINS, ANTIBODIES, COMPOSITIONS, METHODS AND USES.
XX
-KW JP 2005522996-A/12.
+KW JP 2005522996-A/12; test-data.
XX
OS Homo sapiens (human)
OC Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; Mammalia;
View
29 Tests/test_SeqIO_Insdc.py
@@ -0,0 +1,29 @@
+# Copyright 2013 by Peter Cock. All rights reserved.
+# This code is part of the Biopython distribution and governed by its
+# license. Please see the LICENSE file that should have been included
+# as part of this package.
+
+import unittest
+
+from Bio import SeqIO
+
+class TestEmbl(unittest.TestCase):
+ def test_annotation1(self):
+ """Check parsing of annotation from EMBL files (1)."""
+ record = SeqIO.read("EMBL/TRBG361.embl", "embl")
+ self.assertEqual(len(record), 1859)
+ #Single keyword:
+ self.assertEqual(record.annotations["keywords"], ["beta-glucosidase"])
+
+ def test_annotation2(self):
+ """Check parsing of annotation from EMBL files (2)."""
+ record = SeqIO.read("EMBL/DD231055_edited.embl", "embl")
+ self.assertEqual(len(record), 315)
+ #Multiple keywords:
+ self.assertEqual(record.annotations["keywords"],
+ ['JP 2005522996-A/12', 'test-data'])
+
+
+if __name__ == "__main__":
+ runner = unittest.TextTestRunner(verbosity=2)
+ unittest.main(testRunner=runner)

0 comments on commit 680354c

Please sign in to comment.
Something went wrong with that request. Please try again.