summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2012-05-30 16:09:50 +0400
committergebele <gebele@in-silico.ch>2012-05-30 16:09:50 +0400
commitd1080a6888ad6fcc3dfe23a7fd910030fdcf0c94 (patch)
treeb6439f2f5b8082eb08034fc1ae419276c3638cad
parent1519c506976c9eb9de443dae0b574b167123018f (diff)
enabled zip upload to update existing investigation/included modified valid test data BII-I-1b
-rw-r--r--test/data/toxbank-investigation/valid/BII-I-1.zipbin13684 -> 13640 bytes
-rw-r--r--test/data/toxbank-investigation/valid/BII-I-1b.zipbin0 -> 13651 bytes
-rw-r--r--test/toxbank-investigation-rest.rb11
3 files changed, 9 insertions, 2 deletions
diff --git a/test/data/toxbank-investigation/valid/BII-I-1.zip b/test/data/toxbank-investigation/valid/BII-I-1.zip
index fbe4cdf..2ccbb4d 100644
--- a/test/data/toxbank-investigation/valid/BII-I-1.zip
+++ b/test/data/toxbank-investigation/valid/BII-I-1.zip
Binary files differ
diff --git a/test/data/toxbank-investigation/valid/BII-I-1b.zip b/test/data/toxbank-investigation/valid/BII-I-1b.zip
new file mode 100644
index 0000000..43629db
--- /dev/null
+++ b/test/data/toxbank-investigation/valid/BII-I-1b.zip
Binary files differ
diff --git a/test/toxbank-investigation-rest.rb b/test/toxbank-investigation-rest.rb
index 1dcc3d2..b3cc05a 100644
--- a/test/toxbank-investigation-rest.rb
+++ b/test/toxbank-investigation-rest.rb
@@ -34,7 +34,7 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
# create an investigation by uploading a zip file
def test_02_post_investigation
@@uri = ""
- file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1.zip"
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1b.zip"
#task_uri = `curl -k -X POST #{$toxbank_investigation[:uri]} -H "Content-Type: multipart/form-data" -F "file=@#{file};type=application/zip" -H "subjectid:#{@@subjectid}"`
response = OpenTox::RestClientWrapper.post $toxbank_investigation[:uri], {:file => File.open(file)}, { :subjectid => @@subjectid }
task_uri = response.chomp
@@ -42,14 +42,21 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
task.wait
uri = task.resultURI
@@uri = URI(uri)
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
assert @@uri.host == URI($toxbank_investigation[:uri]).host
+ assert_match /[TBU\:U296]/, response
+ # POST zip on existing id
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1.zip"
+ OpenTox::RestClientWrapper.post "#{@@uri}", {:file => File.open(file)}, { :subjectid => @@subjectid }
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
+ assert_match /[TBU\:U115]/, response
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 Identifier, [BII\-I\-1]]/, response
assert_match /[Investigation Title, Growth control of the eukaryote cell\: a systems biology study in yeast]/, response
assert_match /[Investigation Description, Background Cell growth underlies many key cellular and developmental processes]/, response
assert_match /[Owning Organisation URI, TBO\:G176, Public]/, response