summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-04-02 14:37:09 +0200
committerChristoph Helma <helma@in-silico.ch>2012-04-02 14:37:09 +0200
commit8a5b0aebfcaf7c82dbc71a5379e5de414dd23a74 (patch)
treec11d61db07a9fb3887ad1007efbbf39934ea9086
parent919b484e72aaee787846e430e65201481e118ad6 (diff)
new toxbank investigation added
-rw-r--r--all.rb2
-rw-r--r--backends.rb4
-rw-r--r--opentox-client.rb6
-rw-r--r--test/toxbank-investigation-curl.rb26
-rw-r--r--toxbank-investigation.rb2
5 files changed, 17 insertions, 23 deletions
diff --git a/all.rb b/all.rb
new file mode 100644
index 0000000..06df8c6
--- /dev/null
+++ b/all.rb
@@ -0,0 +1,2 @@
+require 'test/unit'
+(Dir["test/*.rb"] - Dir["test/setup.rb"]).each { |f| require File.join(File.dirname(__FILE__),f) }
diff --git a/backends.rb b/backends.rb
new file mode 100644
index 0000000..465f3ae
--- /dev/null
+++ b/backends.rb
@@ -0,0 +1,4 @@
+require 'test/unit'
+require './test/store_query.rb'
+require './test/authorization.rb'
+require './test/policy.rb'
diff --git a/opentox-client.rb b/opentox-client.rb
new file mode 100644
index 0000000..121aed6
--- /dev/null
+++ b/opentox-client.rb
@@ -0,0 +1,6 @@
+require 'test/unit'
+require './test/error.rb'
+require './test/task.rb'
+require './test/compound.rb'
+require './test/feature.rb'
+require './test/dataset.rb'
diff --git a/test/toxbank-investigation-curl.rb b/test/toxbank-investigation-curl.rb
index 8b73434..1c6726c 100644
--- a/test/toxbank-investigation-curl.rb
+++ b/test/toxbank-investigation-curl.rb
@@ -17,38 +17,18 @@ class UploadTest < Test::Unit::TestCase
def test_02_get_inexisting
response = `curl -Lk -H "Accept:text/uri-list" -i -H "subjectid:#{@@subjectid}" #{$toxbank_investigation[:uri]}/foo`.chomp
- assert_match /404/, response
+ assert_match /401/, response
response = `curl -Lk -H "Accept:application/rdf+xml" -i -H "subjectid:#{@@subjectid}" #{$toxbank_investigation[:uri]}/999999/metadata`.chomp
- assert_match /404/, response
+ assert_match /401/, response
end
def test_03_valid_zip_upload
# upload
#["isa-tab-renamed.zip"].each do |f|
- ["BII-I-1.zip","isa-tab-renamed.zip"].each do |f|
+ ["BII-I-1.zip","isa-tab-renamed.zip","E-MTAB-798_philippe.zip"].each do |f|
file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", f
response = `curl -Lk -X POST -i -F file="@#{file};type=application/zip" -H "subjectid:#{@@subjectid}" #{$toxbank_investigation[:uri]}`.chomp
assert_match /202/, response
-=begin
-<<<<<<< Updated upstream
- # task
- puts taskuri = response.split("\n")[-1]
- #t = OpenTox::Task.new(taskuri)
- #assert t.running?
- #assert_match t.hasStatus, "Running"
- #t.wait
- #assert t.completed?
- #assert_match t.hasStatus, "Completed"
- #uri = t.resultURI
- count = `curl -Lk -H accept:text/uri-list #{$toxbank_investigation[:uri]}`.split("\n").count-1
- puts uri = "#{$toxbank_investigation[:uri]}\/#{count}"
- # metadata
- metadata = `curl -Lk -H accept:application/rdf+xml "subjectid:#{@@subjectid}" #{uri}/metadata`
- urii = uri.gsub("https", "http")
- assert_match /#{urii}/, metadata
- # zip
-=======
-=end
uri = response.split("\n")[-1]
t = OpenTox::Task.new(uri)
t.wait
diff --git a/toxbank-investigation.rb b/toxbank-investigation.rb
new file mode 100644
index 0000000..c2aeac1
--- /dev/null
+++ b/toxbank-investigation.rb
@@ -0,0 +1,2 @@
+require 'test/unit'
+Dir["test/toxbank*.rb"].each { |f| require File.join(File.dirname(__FILE__),f) }