summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-01-28 18:11:15 +0100
committerChristoph Helma <helma@in-silico.ch>2011-01-28 18:11:15 +0100
commit545f4f9e511d8e39a808a1c24de37eb33d2f026e (patch)
tree7b61495456fe22356e1a8a8e85e3e774878d5af2
parent5f0d5b9ffa13f54b52fa0a41dd2d7f2ab55978f5 (diff)
auth added
-rw-r--r--Rakefile13
-rw-r--r--algorithm.rb2
-rw-r--r--lazar.rb14
-rw-r--r--model.rb2
4 files changed, 20 insertions, 11 deletions
diff --git a/Rakefile b/Rakefile
index a287f95..d260989 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,12 +1,17 @@
require 'rubygems'
require 'opentox-ruby'
-TEST_USER = "guest"
-TEST_PW = "guest"
+if File.exists? "auth.rb"
+ require "auth"
+else
+ #exit "Please create an authenticatio
+ TEST_USER = "guest"
+ TEST_PW = "guest"
+end
task ARGV[0] do
- puts ENV["RACK_ENV"]
- puts ARGV[0]+".rb"
+ puts "Environment: #{ENV["RACK_ENV"]}"
+ puts "Test: "+ARGV[0]+".rb"
require "./"+ARGV[0]+".rb"
end
diff --git a/algorithm.rb b/algorithm.rb
index 94f3b5c..650a6df 100644
--- a/algorithm.rb
+++ b/algorithm.rb
@@ -20,7 +20,7 @@ class AlgorithmTest < Test::Unit::TestCase
def test_metadata
@algorithms.each do |algorithm|
- puts algorithm
+ #puts algorithm
validate_owl(algorithm, @@subjectid)
end
end
diff --git a/lazar.rb b/lazar.rb
index 280f917..a1ab6db 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -31,8 +31,10 @@ class LazarTest < Test::Unit::TestCase
model_uri = OpenTox::Algorithm::Lazar.new.run({:dataset_uri => @@classification_training_dataset.uri, :subjectid => @@subjectid}).to_s
lazar = OpenTox::Model::Lazar.find model_uri, @@subjectid
assert_equal lazar.features.size, 41
+
# single prediction
compound = OpenTox::Compound.from_smiles("c1ccccc1NN")
+ #puts compound.uri
prediction_uri = lazar.run(:compound_uri => compound.uri, :subjectid => @@subjectid)
prediction = OpenTox::LazarPrediction.find(prediction_uri, @@subjectid)
assert_equal prediction.value(compound), false
@@ -44,7 +46,7 @@ class LazarTest < Test::Unit::TestCase
prediction_uri = lazar.run(:compound_uri => compound.uri, :subjectid => @@subjectid)
prediction = OpenTox::LazarPrediction.find prediction_uri, @@subjectid
assert !prediction.measured_activities(compound).empty?
- puts prediction.measured_activities(compound).first.inspect
+ #puts prediction.measured_activities(compound).first.inspect
assert_equal prediction.measured_activities(compound).first, true
assert prediction.value(compound).nil?
prediction.delete(@@subjectid)
@@ -53,13 +55,15 @@ class LazarTest < Test::Unit::TestCase
prediction = OpenTox::LazarPrediction.find lazar.run(:dataset_uri => test_dataset.uri, :subjectid => @@subjectid), @@subjectid
assert_equal prediction.compounds.size, 4
compound = OpenTox::Compound.new prediction.compounds.first
- puts "compound"
- puts compound.inspect
- puts "prediction"
- puts prediction.value(compound).inspect
+ #puts "compound"
+ #puts compound.inspect
+ #puts "prediction"
+ #puts prediction.value(compound).inspect
assert_equal prediction.value(compound), false
prediction.delete(@@subjectid)
lazar.delete(@@subjectid)
+=begin
+=end
end
end
diff --git a/model.rb b/model.rb
index c1832fd..098ed5f 100644
--- a/model.rb
+++ b/model.rb
@@ -17,7 +17,7 @@ class ModelTest < Test::Unit::TestCase
def test_metadata
@models.each do |model|
- puts model
+ #puts model
validate_owl(model)
end
end