summaryrefslogtreecommitdiff
path: root/test/toxbank-investigation-curl.rb
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 /test/toxbank-investigation-curl.rb
parent919b484e72aaee787846e430e65201481e118ad6 (diff)
new toxbank investigation added
Diffstat (limited to 'test/toxbank-investigation-curl.rb')
-rw-r--r--test/toxbank-investigation-curl.rb26
1 files changed, 3 insertions, 23 deletions
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