summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-01-28 14:31:28 +0100
committergebele <gebele@in-silico.ch>2014-01-28 14:31:28 +0100
commit7426f3668bce728bc4194a9c29da2f2cbd69b67d (patch)
tree4fed7bb33f4dd4394900a38d720cd0292b32b59a
parent9400c10348179629f935caf6f9e8ce1e8bcf9088 (diff)
changed/added tests for ftp files path/download links
-rw-r--r--test/toxbank-investigation-rest.rb8
-rw-r--r--test/toxbank-investigation-sparql.rb4
2 files changed, 7 insertions, 5 deletions
diff --git a/test/toxbank-investigation-rest.rb b/test/toxbank-investigation-rest.rb
index b7aebc2..83186cf 100644
--- a/test/toxbank-investigation-rest.rb
+++ b/test/toxbank-investigation-rest.rb
@@ -359,7 +359,7 @@ class TBInvestigationREST < MiniTest::Test
# check that linked FTP file is listed in uri-list
def test_06a_check_ftpfiles
result = OpenTox::RestClientWrapper.get("#{@@uri}", {}, {:accept => "text/uri-list", :subjectid => $pi[:subjectid]}).split("\n")
- assert_match "#{@@uri}/isatab/JIC37_Ethanol_0.07_Internal_1_3.txt", result.to_s
+ assert_match "#{@@uri}/files/JIC37_Ethanol_0.07_Internal_1_3.txt", result.to_s
end
# check that linked FTP file has mime_type
@@ -492,7 +492,7 @@ class TBInvestigationREST < MiniTest::Test
assert_match /<\?xml/, res
#guest is authorized to get ftp file
result = OpenTox::RestClientWrapper.get("#{@@uri}", {}, {:accept => "text/uri-list", :subjectid => $secondpi[:subjectid]}).split("\n")
- assert_match "#{@@uri}/isatab/JIC37_Ethanol_0.07_Internal_1_3.txt", result.to_s
+ assert_match "#{@@uri}/files/JIC37_Ethanol_0.07_Internal_1_3.txt", result.to_s
end
# get investigation/{id}/metadata in rdf and check content
@@ -625,7 +625,7 @@ class TBInvestigationREST < MiniTest::Test
response = OpenTox::RestClientWrapper.get $investigation[:uri], {}, {:accept => "text/uri-list", :subjectid => $pi[:subjectid]}
assert response.index(@@uri.to_s) != nil, "URI: #{@@uri} is not in uri-list"
end
-
+=begin
# delete investigation/{id}
# @note expect code 200
def test_99_a_delete_investigation
@@ -649,6 +649,6 @@ class TBInvestigationREST < MiniTest::Test
response = OpenTox::RestClientWrapper.get $investigation[:uri], {}, {:accept => "text/uri-list", :subjectid => $pi[:subjectid]}
refute_match /#{@@uri}/, response.to_s
end
-
+=end
end
diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb
index 9809c15..1bacfae 100644
--- a/test/toxbank-investigation-sparql.rb
+++ b/test/toxbank-investigation-sparql.rb
@@ -111,7 +111,9 @@ class TBSPARQLTest < MiniTest::Test
response = OpenTox::RestClientWrapper.get "#{@@uri}/sparql/files_by_investigation", {}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
result = JSON.parse(response)
files = result["results"]["bindings"].map{|n| "#{n["file"]["value"]}"}
- assert_equal 180, files.size
+ assert_equal 242, files.size
+ downloaduris = result["results"]["bindings"].map{|n| "#{n["downloaduri"]["value"]}"}
+ assert_match /#{@@uri}\/files\/JIC37_Ethanol_0\.07_Internal_1_3\.txt/, downloaduris.to_s
end
def test_13_investigation_by_characteristic_value