summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-07-08 14:09:02 +0200
committergebele <gebele@in-silico.ch>2014-07-08 14:09:02 +0200
commitefa601e1d7d6572a55d753e765f7ac6e78fd915a (patch)
treee9560ddcbfd3ed3e6c7fbcaa165ef0e4baa257a6
parenta964a44b61a7f5f6d54a8757f0e6dbf090533b9d (diff)
adjust test allow missing owningPro
-rw-r--r--test/toxbank-investigation-types.rb39
1 files changed, 25 insertions, 14 deletions
diff --git a/test/toxbank-investigation-types.rb b/test/toxbank-investigation-types.rb
index d3056ce..79c22a9 100644
--- a/test/toxbank-investigation-types.rb
+++ b/test/toxbank-investigation-types.rb
@@ -149,20 +149,6 @@ class TBInvestigationNoISADataInvalidPOST < MiniTest::Test
assert_equal "Parameter 'owningOrg' is required.", task.error_report[RDF::OT.message], "wrong error: #{task.error_report[RDF::OT.message]}."
end
- # missing owningPro
- # @note expect OpenTox::BadRequestError
- def test_attached_file_missing_owningPro
- puts "\nattached file missing owningPro"
- file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "unformated.zip"
- response = OpenTox::RestClientWrapper.post $investigation[:uri], {:file => File.open(file), :type => "unformattedData", :title => "New Title", :abstract => "This is a short description", :owningOrg => "#{$user_service[:uri]}/organisation/G16", :authors => "#{$user_service[:uri]}/user/U271, #{$user_service[:uri]}/user/U479", :keywords => "http://www.owl-ontologies.com/toxbank.owl/K124, http://www.owl-ontologies.com/toxbank.owl/K727" }, { :subjectid => $pi[:subjectid] }
- task_uri = response.chomp
- task = OpenTox::Task.new task_uri
- task.wait
- #puts task_uri
- assert_equal "Error", task.hasStatus, "Task should be not completed but is: #{task.hasStatus}. Task URI is #{task_uri} ."
- assert_equal "Parameter 'owningPro' is required.", task.error_report[RDF::OT.message], "wrong error: #{task.error_report[RDF::OT.message]}."
- end
-
# missing authors
# @note expect OpenTox::BadRequestError
def test_attached_file_missing_authors
@@ -240,6 +226,31 @@ class TBInvestigationNoISADataInvalidPOST < MiniTest::Test
end
class TBInvestigationNoISADataValidPOST < MiniTest::Test
+
+ # missing owningPro
+ def test_attached_file_without_owningPro
+ puts "\nattached file missing owningPro"
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "unformated.zip"
+ response = OpenTox::RestClientWrapper.post $investigation[:uri], {:file => File.open(file), :type => "unformattedData", :title => "New Title", :abstract => "This is a short description", :owningOrg => "#{$user_service[:uri]}/organisation/G16", :authors => "#{$user_service[:uri]}/user/U271, #{$user_service[:uri]}/user/U479", :keywords => "http://www.owl-ontologies.com/toxbank.owl/K124, http://www.owl-ontologies.com/toxbank.owl/K727" }, { :subjectid => $pi[:subjectid] }
+ task_uri = response.chomp
+ task = OpenTox::Task.new task_uri
+ task.wait
+ #puts task_uri
+ assert_equal "Completed", task.hasStatus, "Task should be not completed but is: #{task.hasStatus}. Task URI is #{task_uri} ."
+ end
+
+ # missing owningPro
+ def test_no_file_without_owningPro
+ puts "\nattached file missing owningPro"
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "unformated.zip"
+ response = OpenTox::RestClientWrapper.post $investigation[:uri], {:type => "noData", :title => "New Title", :abstract => "This is a short description", :owningOrg => "#{$user_service[:uri]}/organisation/G16", :authors => "#{$user_service[:uri]}/user/U271, #{$user_service[:uri]}/user/U479", :keywords => "http://www.owl-ontologies.com/toxbank.owl/K124, http://www.owl-ontologies.com/toxbank.owl/K727" }, { :subjectid => $pi[:subjectid] }
+ task_uri = response.chomp
+ task = OpenTox::Task.new task_uri
+ task.wait
+ #puts task_uri
+ assert_equal "Completed", task.hasStatus, "Task should be not completed but is: #{task.hasStatus}. Task URI is #{task_uri} ."
+ end
+
def test_01_post_type_nodata
puts "\nvalid noData"