[Biopython-dev] [Bug 2840] When a record has been loaded from BioSQL, trying to save it to another database fails with loader db_loader.load_seqrecord in _load_reference

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue May 26 14:17:48 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2840





------- Comment #4 from cymon.cox at gmail.com  2009-05-26 10:17 EST -------
(In reply to comment #3)
> (In reply to comment #1)

The functions in old Tests/BioSQL_Seq.py have moved to seq_tests_common.py. So
ive updated the seq_tests_common:

diff --git a/Tests/seq_tests_common.py b/Tests/seq_tests_common.py
index d3b7fb4..392a96c 100644
--- a/Tests/seq_tests_common.py
+++ b/Tests/seq_tests_common.py
@@ -40,10 +40,17 @@ def compare_references(old_r, new_r) :
     #allow us to store a consortium.
     assert new_r.consrtm == ""

-    #TODO - reference location?
-    #The parser seems to give a location object (i.e. which
-    #nucleotides from the file is the reference for), while the
-    #we seem to use the database to hold the journal details (!)
+    # Reference location
+    if old_r.location == []:
+        assert new_r.location == [], "old_r.location %s != " \
+            "new_r.location %s" % (old_r.location, new_r.location)
+    else:
+        assert old_r.location[0].start == new_r.location[0].start, \
+        "old_r.location[0].start %s != new_r.location[0].start %s" % \
+        (old_r.location[0].start, new_r.location[0].start)
+        assert old_r.location[0].end == new_r.location[0].end, \
+        "old_r.location[0].end %s != new_r.location[0].end %s" % \
+        (old_r.location[0].end, new_r.location[0].end)
     return True

Pushed to http://github.com/cymon/biopython-github-master/tree/bug2840
C.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list