Permalink
Browse files

TogoWS works with DDBJ again.

This partially reverts d206958
which avoided the DDBJ database tests during their supercomputer
migration.
  • Loading branch information...
1 parent f202f7c commit 8f49eff6a6309681410827dd9b59a4e28fb31e12 @peterjc peterjc committed Dec 29, 2012
Showing with 19 additions and 12 deletions.
  1. +19 −12 Tests/test_TogoWS.py
View
@@ -204,9 +204,16 @@ def test_invalid_db(self):
self.assertRaises(ValueError, TogoWS.entry,
"invalid_db", "invalid_id")
- def test_nucleotide_genbank(self):
- """Bio.TogoWS.entry("nucleotide", "X52960")"""
- handle = TogoWS.entry("nucleotide", "X52960") # Returns "genbank" format
+ def test_ddbj_genbank_length(self):
+ """Bio.TogoWS.entry("ddbj", "X52960", field="length")"""
+ handle = TogoWS.entry("ddbj", "X52960", field="length")
+ data = handle.read().strip() #ignore trailing \n
+ handle.close()
+ self.assertEqual(data, "248")
+
+ def test_ddbj_genbank(self):
+ """Bio.TogoWS.entry("ddbj", "X52960")"""
+ handle = TogoWS.entry("ddbj", "X52960") #Returns "genbank" format
record = SeqIO.read(handle, "gb")
handle.close()
self.assertEqual(record.id, "X52960.1")
@@ -273,12 +280,12 @@ def test_nucleotide_invalid_format(self):
self.assertRaises(ValueError, TogoWS.entry,
"nucleotide", "X52960", format="invalid_for_testing")
- #def test_ddbj_gff3(self):
- # """Bio.TogoWS.entry("ddbj", "X52960", format="gff")"""
- # handle = TogoWS.entry("ddbj", "X52960", format="gff")
- # data = handle.read()
- # handle.close()
- # self.assert_(data.startswith("##gff-version 3\nX52960\tDDBJ\t"), data)
+ def test_ddbj_gff3(self):
+ """Bio.TogoWS.entry("ddbj", "X52960", format="gff")"""
+ handle = TogoWS.entry("ddbj", "X52960", format="gff")
+ data = handle.read()
+ handle.close()
+ self.assert_(data.startswith("##gff-version 3\nX52960\tDDBJ\t"), data)
def test_genbank_gff3(self):
"""Bio.TogoWS.entry("nucleotide", "X52960", format="gff")"""
@@ -320,9 +327,9 @@ def test_embl_AM905444(self):
self.assertEqual(len(record), 1164)
self.assertEqual(seguid(record.seq), "G0HtLpwF7i4FXUaUjDUPTjok79c")
- def test_nucleotide_fasta(self):
- """Bio.TogoWS.entry("nucleotide", "X52960", "fasta")"""
- handle = TogoWS.entry("nucleotide", "X52960", "fasta")
+ def test_ddbj_fasta(self):
+ """Bio.TogoWS.entry("ddbj", "X52960", "fasta")"""
+ handle = TogoWS.entry("ddbj", "X52960", "fasta")
record = SeqIO.read(handle, "fasta")
handle.close()
self.assert_("X52960" in record.id, record.id)

0 comments on commit 8f49eff

Please sign in to comment.