Sha256: 12c0ae343b75ea99666feae1c4b40eac8e363043109c510bb35e511c60700f0d

Contents?: true

Size: 1.82 KB

Versions: 18

Compression:

Stored size: 1.82 KB

Contents

#
# test/unit/bio/appl/sosui/test_report.rb - Unit test for Bio::SOSUI::Report
#
# Copyright::   Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
# License::     The Ruby License
#
#  $Id: test_report.rb,v 1.5 2007/04/05 23:35:43 trevor Exp $
#

require 'pathname'
libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s
$:.unshift(libpath) unless $:.include?(libpath)

require 'test/unit'
require 'bio/appl/sosui/report'


module Bio

  bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s
  test_data = Pathname.new(File.join(bioruby_root, 'test', 'data', 'SOSUI')).cleanpath.to_s
  SOSUIReport = File.open(File.join(test_data, 'sample.report')).read


  class TestSOSUIReportConst  < Test::Unit::TestCase

    def test_delimiter
      assert_equal("\n>", Bio::SOSUI::Report::DELIMITER)
    end

    def test_rs
      assert_equal("\n>", Bio::SOSUI::Report::RS)
    end

  end


  class TestSOSUIReport < Test::Unit::TestCase

    def setup
      @obj = Bio::SOSUI::Report.new(SOSUIReport)
    end

    def test_entry_id
      assert_equal('Q9HC19', @obj.entry_id)
    end

    def test_prediction
      assert_equal('MEMBRANE PROTEIN', @obj.prediction)
    end

    def test_tmhs
      assert_equal(Array, @obj.tmhs.class)
      assert_equal(Bio::SOSUI::Report::TMH, @obj.tmhs[0].class)
    end

    def test_tmh
      assert_equal(7, @obj.tmhs.size)
    end

  end # class TestSOSUIReport

  class TestSOSUITMH < Test::Unit::TestCase
    def setup
      @obj = Bio::SOSUI::Report.new(SOSUIReport).tmhs.first
    end

    def test_range
      assert_equal(31..53, @obj.range)
    end

    def test_grade
      assert_equal('SECONDARY', @obj.grade)
    end
    
    def test_sequence
      assert_equal('HIRMTFLRKVYSILSLQVLLTTV', @obj.sequence)
    end

  end # class TestSOSUITMH
end

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
bioruby-bio-1.2.9.9001 test/unit/bio/appl/sosui/test_report.rb
bioruby-bio-1.2.9.9501 test/unit/bio/appl/sosui/test_report.rb
bioruby-bio-1.3.0.5000 test/unit/bio/appl/sosui/test_report.rb
bioruby-bio-1.3.0.9901 test/unit/bio/appl/sosui/test_report.rb
bioruby-bio-1.3.0 test/unit/bio/appl/sosui/test_report.rb
bioruby-bio-1.3.1.5000 test/unit/bio/appl/sosui/test_report.rb
jandot-bio-1.2.1 test/unit/bio/appl/sosui/test_report.rb
ngoto-bio-1.2.9.9001 test/unit/bio/appl/sosui/test_report.rb
ngoto-bio-1.2.9.9501 test/unit/bio/appl/sosui/test_report.rb
ngoto-bio-1.3.0.5000 test/unit/bio/appl/sosui/test_report.rb
ngoto-bio-1.3.0 test/unit/bio/appl/sosui/test_report.rb
ngoto-bio-1.3.1.5000 test/unit/bio/appl/sosui/test_report.rb
wwood-bioruby-1.2.11 test/unit/bio/appl/sosui/test_report.rb
bio-1.3.1 test/unit/bio/appl/sosui/test_report.rb
bio-1.2.1 test/unit/bio/appl/sosui/test_report.rb
bio-1.1.0 test/unit/bio/appl/sosui/test_report.rb
bio-1.2.0 test/unit/bio/appl/sosui/test_report.rb
bio-1.3.0 test/unit/bio/appl/sosui/test_report.rb