summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2014-05-27 14:44:25 +0200
committerrautenberg <rautenberg@in-silico.ch>2014-05-27 14:44:25 +0200
commited226cdb961421c56a1d63bbb2e9edeb41718858 (patch)
tree7f57d1538e1423aa76d6abf3c0cc3cb03ae96651
parentdddec76c93bfcc260bce5ecddd408d9ce5d256b1 (diff)
add ftp subdir testing
-rw-r--r--test/data/toxbank-investigation/valid/BII-I-1-tb2_ftp.zipbin13472 -> 13482 bytes
-rw-r--r--test/toxbank-investigation-sparql.rb2
-rw-r--r--test/toxbank-investigation-types.rb5
3 files changed, 6 insertions, 1 deletions
diff --git a/test/data/toxbank-investigation/valid/BII-I-1-tb2_ftp.zip b/test/data/toxbank-investigation/valid/BII-I-1-tb2_ftp.zip
index f131cb2..5acd742 100644
--- a/test/data/toxbank-investigation/valid/BII-I-1-tb2_ftp.zip
+++ b/test/data/toxbank-investigation/valid/BII-I-1-tb2_ftp.zip
Binary files differ
diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb
index 392bbb8..4a70788 100644
--- a/test/toxbank-investigation-sparql.rb
+++ b/test/toxbank-investigation-sparql.rb
@@ -261,7 +261,7 @@ class TBSPARQLTestExtended < MiniTest::Test
response = OpenTox::RestClientWrapper.get "#{@@uri}/sparql/files_by_investigation", {}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
result = JSON.parse(response)
#puts result
- ["assay", "assayFile", "endpoint", "endpointLabel", "platform", "technology", "techLabel", "file", "term"].each do |v|
+ ["assay", "assayFile", "endpoint", "endpointLabel", "platform", "technology", "techLabel", "file", "term", "downloaduri"].each do |v|
assert result["head"]["vars"].include?(v.to_s)
end
end
diff --git a/test/toxbank-investigation-types.rb b/test/toxbank-investigation-types.rb
index 6bb146f..0958e5c 100644
--- a/test/toxbank-investigation-types.rb
+++ b/test/toxbank-investigation-types.rb
@@ -353,12 +353,17 @@ class TBInvestigationNoISADataValidPOST < MiniTest::Test
# GET file in uri-list
response = OpenTox::RestClientWrapper.get uri.to_s, {}, {:accept => "text/uri-list", :subjectid => $pi[:subjectid] }
assert_match /JIC37_Ethanol_0.07_Internal_1_3.txt/, response.to_s
+ assert_match /subdir\/JIC37_Ethanol_0.07_Internal_1_3.txt/, response.to_s
# GET file
response = OpenTox::RestClientWrapper.get uri.to_s+"/files/JIC37_Ethanol_0.07_Internal_1_3.txt", {}, { :subjectid => $pi[:subjectid] }
assert_equal "200", response.code.to_s
assert_match /isttest/, response.to_s
+ response = OpenTox::RestClientWrapper.get uri.to_s+"/files/subdir_JIC37_Ethanol_0.07_Internal_1_3.txt", {}, { :subjectid => $pi[:subjectid] }
+ assert_equal "200", response.code.to_s
+ assert_match /isttest subdir/, response.to_s
+
# PUT
response = OpenTox::RestClientWrapper.put uri, {:type => "ftpData", :title => "Second Title", :abstract => "This is a short description", :owningOrg => "#{$user_service[:uri]}/organisation/G16", :authors => "#{$user_service[:uri]}/user/U271, #{$user_service[:uri]}/user/U479", :owningPro => "#{$user_service[:uri]}/project/G81", :keywords => "http://www.owl-ontologies.com/toxbank.owl/K124, http://www.owl-ontologies.com/toxbank.owl/K727", :ftpFile => "JIC37_Ethanol_0.07_Internal_1_3.txt"}, { :subjectid => $pi[:subjectid] }
task_uri = response.chomp