summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-10-06 10:39:43 +0200
committerChristoph Helma <helma@in-silico.de>2009-10-06 10:39:43 +0200
commit5d5688fbe43806af8523e5481715b5969feeab60 (patch)
treec5b2d26cbc2a2ebffa4606dfded62afd6d4c5821 /test
parent9f16c1ede56a95368044a333f716d09c0240e5ab (diff)
Passes tests in opentox-test
Diffstat (limited to 'test')
-rw-r--r--test/hamster_carcinogenicity.csv85
-rw-r--r--test/opentox-ruby-api-wrapper_test.rb47
-rwxr-xr-xtest/start-local-webservices.rb13
-rw-r--r--test/test_helper.rb10
4 files changed, 0 insertions, 155 deletions
diff --git a/test/hamster_carcinogenicity.csv b/test/hamster_carcinogenicity.csv
deleted file mode 100644
index 009808f..0000000
--- a/test/hamster_carcinogenicity.csv
+++ /dev/null
@@ -1,85 +0,0 @@
-CC=O,true
-C12C3=C(C=CC=C3)CC1=CC(=CC=2)NC(C)=O,true
-O=C(N)\C(C2=CC=CO2)=C/C1=CC=C([N+]([O-])=O)O1,true
-C1(N=CNN=1)N,false
-Br(=O)(=O)[O-].[K+],true
-[Cl-].[Cd+2].[Cl-],false
-O=S(=O)([O-])[O-].[Cd+2],false
-ClC1=CC(=NC(=N1)SCC(=O)O)NC2=CC=CC(=C2C)C,false
-ClCOC,true
-C=C(Cl)C=C,false
-Clc1ccc(cc1)c2ccc(COC(C)(C)C(O)=O)cc2,false
-O=C1OC2=C(C=CC=C2)C=C1,false
-ClC(=C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)Cl,true
-ClC(C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)(Cl)Cl,false
-C=CCN(CC=C)N=O,true
-Cl\C2=C(/Cl)C3(Cl)C1C4CC(C1C2(Cl)C3(Cl)Cl)C5OC45,false
-O=C(N(C)C)Cl,true
-CN(C)N,true
-N(NC)C.[H]Cl.[H]Cl,true
-CCO,false
-O=C(N(CC)N=O)NCCO,true
-O=C(N(CC)N=O)NCC(=O)C,true
-C=O,false
-[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NNC=O,true
-O=CC1=CC=CO1,false
-OCC1CO1,true
-O=C2C1=C(OC)C=C(OC)C(Cl)=C1O[C@]32C(OC)=CC(C[C@@](C)3[H])=O,false
-ClC1=C(C(=C(C(=C1Cl)Cl)Cl)Cl)Cl,true
-NN,true
-OS(=O)(=O)O.NN,true
-CC(=O)N(O)C1=CC2=C(C=C1)C3=CC=CC=C3C2,true
-OCCNN,false
-O=C(C1=CC=NC=C1)NN,false
-OC(=O)C1=CC=NC=C1,false
-O=C(NC1=CC=CC(=C1)Cl)OC(C)C,false
-O=C(NC1=CC=CC=C1)OC(C)C,false
-[O-]C(C)=O.[O-]C(C)=O.[Pb+2].[OH-].[OH-].[Pb+2].[OH-].[OH-].[Pb+2],false
-CN(C)CCN(CC2=CC=CS2)C1=NC=CC=C1.Cl,false
-NC1=C2C(=NC(=N1)N)N=CC(=N2)CN(C3=CC=C(C=C3)C(=O)N[C@@H](CCC(=O)O)C(=O)O)C,false
-CN(N)C=O,true
-O=C(C(=C)C)OC,false
-CNN,true
-O=C(C1=CC=CN=C1)CCCN(N=O)C,false
-CC1=CC(=O)NC(=S)N1,true
-CC(C(O)=O)(OC1=CC=C(C=C1)C2CCCC3=C2C=CC=C3)C,false
-O=N[O-].[Na+],false
-[O-][N+](C1=CC=C(C2=CSC(NC(C)=O)=N2)O1)=O,true
-[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NC=O,true
-O=[N+](C1=CC=C2C3=C1C=CC=C3CC2)[O-],false
-N(CC(CO)O)(CC(O)C)N=O,true
-N(CC(CO)O)(CC(C)=O)N=O,true
-N(CC(CO)O)(CCO)N=O,false
-O=C(C)CN(N=O)CCO,true
-C1C(N(C(CN1N=O)C)C)C,true
-N(CC(C)=O)(CC=C)N=O,true
-N(CC(CO)O)(C)N=O,true
-O=NN1CCOCC1,true
-N1C=CC=C(C=1)C2N(N=O)CCC2,true
-C1=CC=C(C=[N+]1[O-])C2CCCN2N=O,false
-O=NN1CCCCC1,true
-O=NN1CCCC1,true
-O=C(N(CC(C)=O)N=O)NCCCl,true
-N(C(=O)N)(N=O)CC(C)=O,true
-C1(CCN=C=S)=CC=CC=C1,false
-O=C1C(C2=CC=CC=C2)(C(=O)NC(=O)N1)CC,false
-C1=C2C(=CC=C1NC3=CC=CC=C3)C=CC=C2,false
-O=C1N2C(C3=C(C=CC=C3)CC2)CN(C1)C(=O)C4CCCCC4,false
-C1(=CC(=C(O)C=C1)O)C(O)=O,false
-O=C1C2=C(C=C(C=C2O)O)O/C(=C\1O)C3=CC(=C(C=C3)O)O.O.O,false
-C1=C(C=CC(=C1)C(C2=CC=C(N)C(=C2)C)=C3C=CC(=N)C=C3)N.[H]Cl,false
-C(C1=CC=C(C=C1)N)(C2=CC=C(C=C2)N)=C3C=CC(C=C3)=N.[H]Cl,false
-OC2=CC1=C(C(O)=C2)C(C(O[C@@H]4O[C@@H]([C@H]([C@H](O)[C@H]4O)O)CO[C@H]3[C@H](O)[C@H](O)[C@H]([C@H](C)O3)O)=C(C5=CC(O)=C(C=C5)O)O1)=O,false
-ClC(=CCl)Cl,false
-NC(=O)OCC,true
-C=CCl,true
-N#[N+]C1=CC=CC=C1.F[B-](F)(F)F,false
-C1(CN(CC(N1N=O)C)N=O)C,true
-N(CCN(C)C)(C)N=O,true
-C1(CN(N=O)CC(O1)C)C,true
-O1C(N(CC1C)N=O)=O,true
-CCOC(=O)N(C)N=O,true
-C1N(COC1)N=O,true
-O=C(N(CCC1=CC=CC=C1)N=O)N,true
-O=NN1CCC1,true
-F[B-](F)(F)F.[Na+],false
diff --git a/test/opentox-ruby-api-wrapper_test.rb b/test/opentox-ruby-api-wrapper_test.rb
deleted file mode 100644
index 0a394e2..0000000
--- a/test/opentox-ruby-api-wrapper_test.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require File.join(File.dirname(__FILE__), 'test_helper.rb')
-
-class OpentoxRubyApiWrapperTest < Test::Unit::TestCase
-
- def setup
- if ENV['LOCAL']
- port = 5000
- [ "opentox-compound", "opentox-feature" , "opentox-dataset" , "opentox-fminer" , "opentox-lazar" ].each do |component|
- ENV[component.upcase.gsub(/-/,'_')] = "http://localhost:#{port}/"
- port += 1
- end
- end
- ENV['OPENTOX'] = "test"
- end
-
- def test_create_dataset_and_model_and_make_a_prediction
- dataset = OpenTox::Dataset.new :name => "Hamster Carcinogenicity", :filename => "test/hamster_carcinogenicity.csv"
- puts dataset.uri
- wait_for_completion dataset
- assert_match(/#{ENV['OPENTOX_DATASET']}\d+$/,dataset.uri)
- assert_equal("Hamster Carcinogenicity",dataset.name)
- assert_equal(true,dataset.finished?)
- lazar = OpenTox::Lazar.new :dataset_uri => dataset.uri
- puts lazar.uri
- wait_for_completion lazar
- assert_equal(true,lazar.finished?)
- assert_match(/#{ENV['OPENTOX_LAZAR']}model\/\d+$/,lazar.uri)
- query_structure = OpenTox::Compound.new :smiles => 'c1ccccc1NN'
- puts query_structure.uri
- prediction = lazar.predict query_structure
- puts prediction.uri
- wait_for_completion prediction
- puts prediction.classification
- puts prediction.confidence
- puts prediction.neighbors
- puts prediction.features
- assert_equal(true, prediction.classification)
- assert_match(/0\.\d+/, prediction.confidence.to_s)
- end
-
-end
-
-def wait_for_completion(object)
- while (!object.finished?)
- sleep 1
- end
-end
diff --git a/test/start-local-webservices.rb b/test/start-local-webservices.rb
deleted file mode 100755
index 66dea29..0000000
--- a/test/start-local-webservices.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env ruby
-require 'fileutils'
-
-port = 5000
-[ "opentox-compound", "opentox-feature" , "opentox-dataset" , "opentox-fminer" , "opentox-lazar" ].each do |component|
- ENV[component.upcase.gsub(/-/,'_')] = "http://localhost:#{port}/"
- Dir.chdir ENV['HOME'] + '/webservices/' + component
- Dir["test.sqlite3"].each { |f| FileUtils.rm_rf(f) }
- file = 'application.rb'
- pid = fork {`urxvt -title #{component} -e thin --debug --rackup config.ru start -p #{port} -e test`}
- Process.detach(pid)
- port += 1
-end
diff --git a/test/test_helper.rb b/test/test_helper.rb
deleted file mode 100644
index 4911cf4..0000000
--- a/test/test_helper.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'rubygems'
-require 'test/unit'
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-
-require 'opentox-ruby-api-wrapper'
-
-class Test::Unit::TestCase
-end