summaryrefslogtreecommitdiff
path: root/test/toxbank-investigation-rest.rb
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2012-05-08 13:20:38 +0200
committerrautenberg <rautenberg@in-silico.ch>2012-05-08 13:20:38 +0200
commit1519c506976c9eb9de443dae0b574b167123018f (patch)
treecd3f0ccf596ab52f3455db5ca0808f6fb1b9ea49 /test/toxbank-investigation-rest.rb
parent96916da933e1bc53db69b3d3e8b335de4e77c0aa (diff)
check metadata via RestClientWrapper at /id/metadata
Diffstat (limited to 'test/toxbank-investigation-rest.rb')
-rw-r--r--test/toxbank-investigation-rest.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/toxbank-investigation-rest.rb b/test/toxbank-investigation-rest.rb
index 5421972..1dcc3d2 100644
--- a/test/toxbank-investigation-rest.rb
+++ b/test/toxbank-investigation-rest.rb
@@ -43,8 +43,11 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
uri = task.resultURI
@@uri = URI(uri)
assert @@uri.host == URI($toxbank_investigation[:uri]).host
- # check_rdf
- response = `curl -i -k -H subjectid:#{@@subjectid} -H accept:application/rdf+xml #{uri}`.chomp
+ end
+
+ # get investigation/{id}/metadata in rdf and check contents
+ def test_03_check_metadata
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
assert_match /[Term Source Name, OBI, DOID, BTO, NEWT, UO, CHEBI, PATO, TBP, TBC, TBO, TBU, TBK]/, response
assert_match /[Investigation Identifier, BII\-I\-1]/, response
assert_match /[Investigation Title, Growth control of the eukaryote cell\: a systems biology study in yeast]/, response
@@ -55,8 +58,9 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
assert_match /[Investigation keywords, TBK\:Blotting, Southwestern;TBK\:Molecular Imaging;DOID\:primary carcinoma of the liver cells]/, response
end
+
# get investigation/{id} as text/uri-list
- def test_03_get_investigation_uri_list
+ def test_04_get_investigation_uri_list
#puts @@uri
#@@uri = "http://toxbank-ch.in-silico.ch/60"
result = OpenTox::RestClientWrapper.get @@uri.to_s, {}, {:accept => "text/uri-list", :subjectid => @@subjectid}
@@ -65,19 +69,19 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
end
# get investigation/{id} as application/zip
- def test_04_get_investigation_zip
+ def test_05_get_investigation_zip
result = OpenTox::RestClientWrapper.get @@uri.to_s, {}, {:accept => "application/zip", :subjectid => @@subjectid}
assert_equal "application/zip", result.headers[:content_type]
end
# get investigation/{id} as text/tab-separated-values
- def test_05_get_investigation_tab
+ def test_06_get_investigation_tab
result = OpenTox::RestClientWrapper.get @@uri.to_s, {}, {:accept => "text/tab-separated-values", :subjectid => @@subjectid}
assert_equal "text/tab-separated-values;charset=utf-8", result.headers[:content_type]
end
# get investigation/{id} as application/sparql-results+json
- def test_06_get_investigation_sparql
+ def test_07_get_investigation_sparql
result = OpenTox::RestClientWrapper.get @@uri.to_s, {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
assert_equal "application/rdf+xml", result.headers[:content_type]
end