summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-11-04 14:32:32 +0100
committergebele <gebele@in-silico.ch>2013-11-04 14:32:32 +0100
commitb7991c623776bdd995bb84638dd3e31fa23a0bff (patch)
tree74ad24cab791d50c1cc72934791c40e2f7d73917
parent2b16efc4e0fcc6be25e5b56372fcced04e63acdc (diff)
adjusted test for denied upload of xls files
-rw-r--r--test/toxbank-investigation-xls.rb35
1 files 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