summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-03-05 17:49:44 +0100
committergebele <gebele@in-silico.ch>2014-03-05 17:49:44 +0100
commitfeacf943a4505495098c553ea432a5c16f21aafd (patch)
tree58623c23dbc679b16b6499aeed42b563e6ea3093
parent523804fa17b674e8df81f0d9fccdfa9cce84b3fa (diff)
adjusted test for renamed template
-rw-r--r--test/toxbank-investigation-sparql.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb
index b6dd5d1..d2a5c2f 100644
--- a/test/toxbank-investigation-sparql.rb
+++ b/test/toxbank-investigation-sparql.rb
@@ -107,13 +107,25 @@ class TBSPARQLTest < MiniTest::Test
assert_equal 200, response.code
end
- def test_09_files_by_investigation
- response = OpenTox::RestClientWrapper.get "#{@@uri}/sparql/files_by_investigation", {}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
+ def test_09_factorvalues_by_investigation
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/sparql/factorvalues_by_investigation", {}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
result = JSON.parse(response)
- files = result["results"]["bindings"].map{|n| "#{n["file"]["value"]}"}
- assert_equal 181, 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
+ #puts result
+ ["sample", "factorname", "value", "ontouri", "unitOnto", "unit", "unitID"].each do |v|
+ assert result["head"]["vars"].include?(v.to_s)
+ end
+
+ sample = result["results"]["bindings"].map{|n| "#{n["sample"]}"}
+ type = result["results"]["bindings"].map{|n| "#{n["sample"]["type"]}"}
+ assert type.include?("uri")
+ value = result["results"]["bindings"].map{|n| "#{n["sample"]["value"]}"}
+ assert value.include?("#{@@uri}/sample2409")
+
+ factorname = result["results"]["bindings"].map{|n| "#{n["factorname"]}"}
+ type = result["results"]["bindings"].map{|n| "#{n["factorname"]["type"]}"}
+ assert type.include?("literal")
+ value = result["results"]["bindings"].map{|n| "#{n["factorname"]["value"]}"}
+ assert value.include?("limiting nutrient")
end
def test_13_investigation_by_characteristic_value