Permalink
Browse files

some simple tests.

  • Loading branch information...
1 parent 6a60f97 commit 606f5f6a5c75b28b474b31e3f1096265e9f154c5 @crm114 committed Oct 11, 2011
Showing with 43 additions and 3 deletions.
  1. +3 −3 lib/mimiweb.rb
  2. +40 −0 test/test_mimiweb.rb
View
@@ -6,16 +6,16 @@ class << self
include HTTParty
BASE_URL = 'http://mimi.ncibi.org/MimiWeb/fetch.jsp?'
def search(term)
- get_results(:search, term)
+ get_results(:search, term, type="")
end
def entrez(id, type="interactions")
get_results(:geneid, id, type)
end
def kegg_compound(id)
- results = get_results(:cid, id)
+ get_results(:cid, id, type="")
end
def kegg_reaction(id)
- get_results(:rid, id)
+ get_results(:rid, id, type="")
end
private
View
@@ -1,4 +1,44 @@
require 'helper'
class TestMimiweb < Test::Unit::TestCase
+ def test_free_text_search
+ term = "pwp1"
+ results = Mimiweb.search(term)
+ assert_equal 'Array', results.class.to_s
+ end
+ def test_entrez_compounds_search
+ term = 7389
+ results = Mimiweb.entrez(term, :compounds)
+ assert_equal 'Array', results.class.to_s
+ end
+
+ def test_entrez_reactions_search
+ term = 1436
+ results = Mimiweb.entrez(term, :reactions)
+ assert_equal 'Hashie::Mash', results.class.to_s
+ end
+
+ def test_entrez_nlp_search
+ term = 4005
+ results = Mimiweb.entrez(term, :nlp)
+ assert_equal 'Array', results.class.to_s
+ end
+
+ def test_entrez_interactions_search
+ term = 1436
+ results = Mimiweb.entrez(term)
+ assert_equal 'Array', results.class.to_s
+ end
+
+ def test_kegg_compound_search
+ term = "C00061"
+ results = Mimiweb.kegg_compound(term)
+ assert_equal 'Hashie::Mash', results.class.to_s
+ end
+
+ def test_kegg_reactions_search
+ term = "R00548"
+ results = Mimiweb.kegg_reaction(term)
+ assert_equal 'Hashie::Mash', results.class.to_s
+ end
end

0 comments on commit 606f5f6

Please sign in to comment.