test/unit/bio/db/embl/test_sptr.rb in bio-1.2.1 vs test/unit/bio/db/embl/test_sptr.rb in bio-1.3.0
- old
+ new
@@ -2,11 +2,11 @@
# test/unit/bio/db/embl/test_sptr.rb - Unit test for Bio::SPTR
#
# Copyright::: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
# License:: The Ruby License
#
-# $Id: test_sptr.rb,v 1.7 2007/04/05 23:35:43 trevor Exp $
+# $Id:$
#
require 'pathname'
libpath = Pathname.new(File.join(File.dirname(__FILE__),
['..'] * 5, 'lib')).cleanpath.to_s
@@ -74,9 +74,46 @@
assert_equal(acs, @obj.accessions)
end
def test_accession
assert_equal('P04637', @obj.accession)
+ end
+
+ def test_dr
+ assert_equal(17, @obj.dr.size)
+ assert_equal(27, @obj.dr['GO'].size)
+ assert_equal([["IPR002117", "P53"],
+ ["IPR011615", "P53_DNA_bd"],
+ ["IPR012346", "P53_RUNT_DNA_bd"],
+ ["IPR010991", "p53_tetrameristn"]],
+ @obj.dr['InterPro'])
+ end
+
+ def test_dr_with_key
+ pfam = [
+ { " " => "1",
+ "Version" => "P53",
+ "Accession" => "PF00870",
+ "Molecular Type" => nil
+ },
+ { " " => "1",
+ "Version" => "P53_tetramer",
+ "Accession" => "PF07710",
+ "Molecular Type" => nil
+ }
+ ]
+ assert_equal(pfam, @obj.dr('Pfam'))
+ embl3 = {
+ " " => "JOINED",
+ "Version" => "AAA59987.1",
+ "Accession" => "M13113",
+ "Molecular Type" => "Genomic_DNA"
+ }
+ assert_equal(embl3, @obj.dr('EMBL')[3])
+ end
+
+ def test_dr_with_key_empty
+ assert_equal([], @obj.dr('NOT_A_DATABASE'))
end
def test_dt
assert(@obj.dt)
end