[BioRuby-cvs] bioruby/test/unit/bio test_tree.rb,1.2,1.3

Naohisa Goto ngoto at dev.open-bio.org
Wed Dec 13 16:29:39 UTC 2006


Update of /home/repository/bioruby/bioruby/test/unit/bio
In directory dev.open-bio.org:/tmp/cvs-serv8729/test/unit/bio

Modified Files:
	test_tree.rb 
Log Message:
Bio::PhylogeneticTree is renamed to Bio::Tree and
filenames are also renamed from phylogenetictree.rb to tree.rb and
from test_phylogenetictree.rb to test_tree.rb.


Index: test_tree.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_tree.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_tree.rb	6 Oct 2006 14:18:51 -0000	1.2
--- test_tree.rb	13 Dec 2006 16:29:37 -0000	1.3
***************
*** 1,4 ****
  #
! # = test/bio/test_phylogenetictree.rb - unit test for Bio::PhylogeneticTree
  #
  # Copyright::   Copyright (C) 2006
--- 1,4 ----
  #
! # = test/bio/test_tree.rb - unit test for Bio::Tree
  #
  # Copyright::   Copyright (C) 2006
***************
*** 16,31 ****
  
  require 'bio'
! require 'bio/phylogenetictree'
  
  module Bio
!   class TestPhylogeneticTreeEdge < Test::Unit::TestCase
      def setup
!       @obj = Bio::PhylogeneticTree::Edge.new(123.45)
      end
  
      def test_initialize
!       assert_nothing_raised { Bio::PhylogeneticTree::Edge.new }
!       assert_equal(1.23, Bio::PhylogeneticTree::Edge.new(1.23).distance)
!       assert_equal(12.3, Bio::PhylogeneticTree::Edge.new('12.3').distance)
      end
  
--- 16,31 ----
  
  require 'bio'
! require 'bio/tree'
  
  module Bio
!   class TestTreeEdge < Test::Unit::TestCase
      def setup
!       @obj = Bio::Tree::Edge.new(123.45)
      end
  
      def test_initialize
!       assert_nothing_raised { Bio::Tree::Edge.new }
!       assert_equal(1.23, Bio::Tree::Edge.new(1.23).distance)
!       assert_equal(12.3, Bio::Tree::Edge.new('12.3').distance)
      end
  
***************
*** 63,77 ****
        assert_equal("123.45", @obj.to_s)
      end
!   end #class TestPhylogeneticTreeEdge
  
!   class TestPhylogeneticTreeNode < Test::Unit::TestCase
      def setup
!       @obj = Bio::PhylogeneticTree::Node.new
      end
  
      def test_initialize
!       assert_nothing_raised { Bio::PhylogeneticTree::Node.new }
        a = nil
!       assert_nothing_raised { a = Bio::PhylogeneticTree::Node.new('mouse') }
        assert_equal('mouse', a.name)
      end
--- 63,77 ----
        assert_equal("123.45", @obj.to_s)
      end
!   end #class TestTreeEdge
  
!   class TestTreeNode < Test::Unit::TestCase
      def setup
!       @obj = Bio::Tree::Node.new
      end
  
      def test_initialize
!       assert_nothing_raised { Bio::Tree::Node.new }
        a = nil
!       assert_nothing_raised { a = Bio::Tree::Node.new('mouse') }
        assert_equal('mouse', a.name)
      end
***************
*** 123,137 ****
        assert_equal('human', @obj.to_s)
      end
!   end #class TestPhylogeneticTreeNode
  
!   class TestPhylogeneticTree < Test::Unit::TestCase
      def setup
!       @tree  = Bio::PhylogeneticTree.new
      end
  
      def test_get_edge_distance
!       edge = Bio::PhylogeneticTree::Edge.new
        assert_equal(nil, @tree.get_edge_distance(edge))
!       edge = Bio::PhylogeneticTree::Edge.new(12.34)
        assert_equal(12.34, @tree.get_edge_distance(edge))
        assert_equal(12.34, @tree.get_edge_distance(12.34))
--- 123,137 ----
        assert_equal('human', @obj.to_s)
      end
!   end #class TestTreeNode
  
!   class TestTree < Test::Unit::TestCase
      def setup
!       @tree  = Bio::Tree.new
      end
  
      def test_get_edge_distance
!       edge = Bio::Tree::Edge.new
        assert_equal(nil, @tree.get_edge_distance(edge))
!       edge = Bio::Tree::Edge.new(12.34)
        assert_equal(12.34, @tree.get_edge_distance(edge))
        assert_equal(12.34, @tree.get_edge_distance(12.34))
***************
*** 139,145 ****
  
      def test_get_edge_distance_string
!       edge = Bio::PhylogeneticTree::Edge.new
        assert_equal(nil, @tree.get_edge_distance_string(edge))
!       edge = Bio::PhylogeneticTree::Edge.new(12.34)
        assert_equal("12.34", @tree.get_edge_distance_string(edge))
        assert_equal("12.34", @tree.get_edge_distance_string(12.34))
--- 139,145 ----
  
      def test_get_edge_distance_string
!       edge = Bio::Tree::Edge.new
        assert_equal(nil, @tree.get_edge_distance_string(edge))
!       edge = Bio::Tree::Edge.new(12.34)
        assert_equal("12.34", @tree.get_edge_distance_string(edge))
        assert_equal("12.34", @tree.get_edge_distance_string(12.34))
***************
*** 147,151 ****
  
      def test_get_node_name
!       node = Bio::PhylogeneticTree::Node.new
        assert_equal(nil, @tree.get_node_name(node))
        node.name = 'human'
--- 147,151 ----
  
      def test_get_node_name
!       node = Bio::Tree::Node.new
        assert_equal(nil, @tree.get_node_name(node))
        node.name = 'human'
***************
*** 154,159 ****
  
      def test_initialize
!       assert_nothing_raised { Bio::PhylogeneticTree.new }
!       assert_nothing_raised { Bio::PhylogeneticTree.new(@tree) }
      end
  
--- 154,159 ----
  
      def test_initialize
!       assert_nothing_raised { Bio::Tree.new }
!       assert_nothing_raised { Bio::Tree.new(@tree) }
      end
  
***************
*** 164,168 ****
      def test_root=()
        assert_equal(nil, @tree.root)
!       node = Bio::PhylogeneticTree::Node.new
        @tree.root = node
        assert_equal(node, @tree.root)
--- 164,168 ----
      def test_root=()
        assert_equal(nil, @tree.root)
!       node = Bio::Tree::Node.new
        @tree.root = node
        assert_equal(node, @tree.root)
***************
*** 175,199 ****
      end
  
!   end #class TestPhylogeneticTree
  
!   class TestPhylogeneticTree2 < Test::Unit::TestCase
      def setup
        # Note that below data is NOT real. The distances are random.
!       @tree = Bio::PhylogeneticTree.new
!       @mouse      = Bio::PhylogeneticTree::Node.new('mouse')
!       @rat        = Bio::PhylogeneticTree::Node.new('rat')
!       @rodents    = Bio::PhylogeneticTree::Node.new('rodents')
!       @human      = Bio::PhylogeneticTree::Node.new('human')
!       @chimpanzee = Bio::PhylogeneticTree::Node.new('chimpanzee')
!       @primates   = Bio::PhylogeneticTree::Node.new('primates')
!       @mammals    = Bio::PhylogeneticTree::Node.new('mammals')
        @nodes =
          [ @mouse, @rat, @rodents, @human, @chimpanzee, @primates, @mammals ]
!       @edge_rodents_mouse   = Bio::PhylogeneticTree::Edge.new(0.0968)
!       @edge_rodents_rat     = Bio::PhylogeneticTree::Edge.new(0.1125)
!       @edge_mammals_rodents = Bio::PhylogeneticTree::Edge.new(0.2560)
!       @edge_primates_human  = Bio::PhylogeneticTree::Edge.new(0.0386)
!       @edge_primates_chimpanzee = Bio::PhylogeneticTree::Edge.new(0.0503)
!       @edge_mammals_primates    = Bio::PhylogeneticTree::Edge.new(0.2235)
        @edges = [
          [ @rodents,  @mouse,      @edge_rodents_mouse       ],
--- 175,199 ----
      end
  
!   end #class TestTree
  
!   class TestTree2 < Test::Unit::TestCase
      def setup
        # Note that below data is NOT real. The distances are random.
!       @tree = Bio::Tree.new
!       @mouse      = Bio::Tree::Node.new('mouse')
!       @rat        = Bio::Tree::Node.new('rat')
!       @rodents    = Bio::Tree::Node.new('rodents')
!       @human      = Bio::Tree::Node.new('human')
!       @chimpanzee = Bio::Tree::Node.new('chimpanzee')
!       @primates   = Bio::Tree::Node.new('primates')
!       @mammals    = Bio::Tree::Node.new('mammals')
        @nodes =
          [ @mouse, @rat, @rodents, @human, @chimpanzee, @primates, @mammals ]
!       @edge_rodents_mouse   = Bio::Tree::Edge.new(0.0968)
!       @edge_rodents_rat     = Bio::Tree::Edge.new(0.1125)
!       @edge_mammals_rodents = Bio::Tree::Edge.new(0.2560)
!       @edge_primates_human  = Bio::Tree::Edge.new(0.0386)
!       @edge_primates_chimpanzee = Bio::Tree::Edge.new(0.0503)
!       @edge_mammals_primates    = Bio::Tree::Edge.new(0.2235)
        @edges = [
          [ @rodents,  @mouse,      @edge_rodents_mouse       ],
***************
*** 263,267 ****
                     @tree.adjacent_nodes(@mammals).sort(&@by_id))
        # test for not existed nodes
!       assert_equal([], @tree.adjacent_nodes(Bio::PhylogeneticTree::Node.new))
      end
  
--- 263,267 ----
                     @tree.adjacent_nodes(@mammals).sort(&@by_id))
        # test for not existed nodes
!       assert_equal([], @tree.adjacent_nodes(Bio::Tree::Node.new))
      end
  
***************
*** 314,318 ****
  
        # test for not existed nodes
!       assert_equal([], @tree.out_edges(Bio::PhylogeneticTree::Node.new))
      end
  
--- 314,318 ----
  
        # test for not existed nodes
!       assert_equal([], @tree.out_edges(Bio::Tree::Node.new))
      end
  
***************
*** 397,401 ****
        # test for not existed nodes
        flag = nil
!       node = Bio::PhylogeneticTree::Node.new
        r = @tree.each_out_edge(node) do |src, tgt, edge|
          flag = true
--- 397,401 ----
        # test for not existed nodes
        flag = nil
!       node = Bio::Tree::Node.new
        r = @tree.each_out_edge(node) do |src, tgt, edge|
          flag = true
***************
*** 405,409 ****
      end
  
!   end #class TestPhylogeneticTree2
  
  end #module Bio
--- 405,409 ----
      end
  
!   end #class TestTree2
  
  end #module Bio




More information about the bioruby-cvs mailing list