From b7991c623776bdd995bb84638dd3e31fa23a0bff Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 4 Nov 2013 14:32:32 +0100 Subject: adjusted test for denied upload of xls files --- test/toxbank-investigation-xls.rb | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/test/toxbank-investigation-xls.rb b/test/toxbank-investigation-xls.rb index ee5f1ba..486003e 100644 --- a/test/toxbank-investigation-xls.rb +++ b/test/toxbank-investigation-xls.rb @@ -17,6 +17,7 @@ class ExcelUploadTest < MiniTest::Test uri = response.split("\n")[-1] t = OpenTox::Task.new(uri) t.wait + puts t.uri assert_match t.hasStatus, "Error" end @@ -29,38 +30,6 @@ class ExcelUploadTest < MiniTest::Test t = OpenTox::Task.new(uri) t.wait puts t.uri - assert_equal true, t.completed? - uri = t.resultURI - - # get zip file - zip = File.join @tmpdir,"tmp.zip" - `curl -Lk -H "Accept:application/zip" -H "subjectid:#{$pi[:subjectid]}" #{uri} > #{zip}` - `unzip -o #{zip} -d #{@tmpdir}` - [ - "i_Investigation.txt", - "s_BII-S-1.txt", - "s_BII-S-2.txt", - "a_metabolome.txt", - "a_microarray.txt", - "a_proteome.txt", - "a_transcriptome.txt", - ].each{|f| assert_equal true, File.exists?(File.join(@tmpdir,f)) } - - # get isatab files - `curl -Lk -H "Accept:text/uri-list" -H "subjectid:#{$pi[:subjectid]}" #{uri}`.split("\n").each do |u| - if u.match(/txt$/) - response = `curl -Lk -i -H Accept:text/tab-separated-values -H "subjectid:#{$pi[:subjectid]}" #{u}` - assert_match /200/, response - end - end - - # delete - response = `curl -Lk -i -X DELETE -H "subjectid:#{$pi[:subjectid]}" #{uri}` - assert_match /200/, response - response = `curl -Lk -i -H "Accept:text/uri-list" -H "subjectid:#{$pi[:subjectid]}" #{uri}` - assert_match /401/, response - response = `curl -I -Lk -i -H "Accept:text/uri-list" -H "subjectid:#{$pi[:subjectid]}" #{uri}` - assert_match /404/, response + assert_match t.hasStatus, "Error" end - end -- cgit v1.2.3