summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-12-16 19:22:24 +0100
committergebele <gebele@in-silico.ch>2014-12-16 19:22:24 +0100
commit2e16fd539c06d890ab560765f98fdfda24884032 (patch)
tree09831023c66755de8e8812d1220104737f74a242
parentff9a60863f1b24cd14079a10bac996145c5955a0 (diff)
added test for relational operator in bio materials search
-rw-r--r--test/toxbank-investigation-sparql.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb
index 5b5bacb..e05b7a5 100644
--- a/test/toxbank-investigation-sparql.rb
+++ b/test/toxbank-investigation-sparql.rb
@@ -360,9 +360,9 @@ class TBSPARQLTestExtended < MiniTest::Test
def test_20_investigation_by_gene_and_value
# check for FC, pValue, qValue
["FC", "pvalue", "qvalue"].each do |value_type|
- response = OpenTox::RestClientWrapper.get "#{$investigation[:uri]}/sparql/investigation_by_gene_and_value", {:geneIdentifiers => "['entrez:3075', 'uniprot:P10809']", :value => "#{value_type}:0.7"}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
+ response = OpenTox::RestClientWrapper.get "#{$investigation[:uri]}/sparql/investigation_by_gene_and_value", {:geneIdentifiers => "['entrez:3075', 'uniprot:P10809']", :value => "#{value_type}:0.5", :relOperator => "below"}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
result = JSON.parse(response)
- #puts response
+ puts response
["investigation", "datatype", "title", "value"].each do |v|
assert result["head"]["vars"].include?(v.to_s)
end
@@ -370,6 +370,15 @@ class TBSPARQLTestExtended < MiniTest::Test
end
end
+ def test_20_investigation_by_gene_and_value_b
+ # check for FC, pValue, qValue
+ ["FC", "pvalue", "qvalue"].each do |value_type|
+ assert_raises OpenTox::BadRequestError do
+ response = OpenTox::RestClientWrapper.get "#{$investigation[:uri]}/sparql/investigation_by_gene_and_value", {:geneIdentifiers => "['entrez:3075', 'uniprot:P10809']", :value => "#{value_type}:0.5"}, {:accept => "application/json", :subjectid => $pi[:subjectid]}
+ end
+ end
+ end
+
def test_21_investigation_by_gene_and_value
# check for valid request
assert_raises OpenTox::BadRequestError do