summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-01-08 11:59:15 +0100
committergebele <gebele@in-silico.ch>2014-01-08 11:59:15 +0100
commitb4ae6c5c91fb8dca26997c2adf61ce1e90e2e3fa (patch)
treea6c3e0f99cfb02f684449b3a9ef373fa037b4ff8
parent54f2774cfbf286cdcd32f0ccf78c9338d23b11a5 (diff)
added test for files with whitespce in title
-rw-r--r--test/data/toxbank-investigation/valid/BII-I-1-tb2_whitespaces.zipbin0 -> 13447 bytes
-rw-r--r--test/toxbank-investigation-rest.rb15
2 files changed, 15 insertions, 0 deletions
diff --git a/test/data/toxbank-investigation/valid/BII-I-1-tb2_whitespaces.zip b/test/data/toxbank-investigation/valid/BII-I-1-tb2_whitespaces.zip
new file mode 100644
index 0000000..bd43191
--- /dev/null
+++ b/test/data/toxbank-investigation/valid/BII-I-1-tb2_whitespaces.zip
Binary files differ
diff --git a/test/toxbank-investigation-rest.rb b/test/toxbank-investigation-rest.rb
index a8c8028..5e356f4 100644
--- a/test/toxbank-investigation-rest.rb
+++ b/test/toxbank-investigation-rest.rb
@@ -111,6 +111,21 @@ class TBInvestigationREST < MiniTest::Test
end
end
+ def test_01e_upload_zip_with_whitespace_in_file_title
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1-tb2_whitespaces.zip"
+ response = OpenTox::RestClientWrapper.post $investigation[:uri], {:file => File.open(file)}, { :subjectid => $pi[:subjectid] }
+ task_uri = response.chomp
+ task = OpenTox::Task.new task_uri
+ task.wait
+ uri = task.resultURI
+ assert_equal "Completed", task.hasStatus, "Task should be completed but is: #{task.hasStatus}. Task URI is #{task_uri} ."
+ urilist = OpenTox::RestClientWrapper.get( uri, {}, {:accept => 'text/uri-list', :subjectid => $pi[:subjectid] }).split("\n")
+ assert_match /a_micro%20array\.txt/, urilist.to_s
+ singlefile = OpenTox::RestClientWrapper.get "#{uri}/isatab/a_micro%20array.txt", {}, {:accept => 'text/plain', :subjectid => $pi[:subjectid] }
+ assert_equal singlefile.code.to_s, "200"
+ OpenTox::RestClientWrapper.delete uri.to_s, {}, {:subjectid => $pi[:subjectid]}
+ end
+
# create an investigation by uploading a zip file,
# @todo TODO create by uploading text/tab-separated-values
# @todo TODO create by uploading application/vnd.ms-excel