summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2010-03-16 19:42:55 +0100
committerChristoph Helma <helma@in-silico.de>2010-03-16 19:42:55 +0100
commit34f3514d66f082a85fa1082536c4911a6809c7fd (patch)
tree504ea252afbb6d22a09c9433e07d462297264b33
parent08fed3677d1af954d668202cfaa4781997630168 (diff)
initial test for dataset prediction added
-rw-r--r--features/fminer.feature1
-rw-r--r--features/step_definitions/common_steps.rb2
-rw-r--r--features/step_definitions/lazar_steps.rb14
-rw-r--r--features/support/hooks.rb2
4 files changed, 16 insertions, 3 deletions
diff --git a/features/fminer.feature b/features/fminer.feature
index 4e1b83f..9e0dfed 100644
--- a/features/fminer.feature
+++ b/features/fminer.feature
@@ -5,7 +5,6 @@ Feature: Fminer
Given Content-Type is application/x-yaml
And Accept-Type is application/x-yaml
And I post <data> to the dataset webservice
- #And the task is completed
And I apply fminer for <feature>
When the task is completed
Then I should receive a valid URI
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index d42f8ab..1e01717 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -7,8 +7,6 @@ Given /^Accept-Type is (.*)/ do |accept_type|
end
When /^I post (.*) to the (.*) webservice$/ do |data,component|
- #puts @@config[:services].to_yaml
- #puts @@config[:services]["opentox-#{component}"]
case data
when /^file:/
data = File.read(File.join(File.dirname(File.expand_path(__FILE__)),"../data",data.sub(/file:\s+/,'')))
diff --git a/features/step_definitions/lazar_steps.rb b/features/step_definitions/lazar_steps.rb
index c05c07f..eca47a4 100644
--- a/features/step_definitions/lazar_steps.rb
+++ b/features/step_definitions/lazar_steps.rb
@@ -17,3 +17,17 @@ Then /^the model should predict (.*) for (.*)$/ do |activity,smiles|
assert_equal activity.to_s, classification.to_s
end
+Given /^I post the test dataset (.*)$/ do |test_dataset|
+ data = File.read(File.join(File.dirname(File.expand_path(__FILE__)),"../data",test_dataset.sub(/file:\s+/,'')))
+ @test_uri = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(data, :content_type => @content_type).to_s.chomp
+ @resources << @test_uri
+end
+
+Given /^I predict the test dataset$/ do
+ @uri = `curl -X POST -d 'dataset_uri=#{@test_uri}' -H 'Accept:application/x-yaml' #{@uri}`.chomp
+ #puts @uri
+ @task = OpenTox::Task.find(@uri)
+ #puts @task
+ @resources << @uri
+end
+
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 0bc5f6f..1216317 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -3,6 +3,7 @@ Before do
end
After do |scenario|
+#=begin
@resources.uniq!
@resources.each do |resource|
begin
@@ -11,4 +12,5 @@ After do |scenario|
puts "Cannot delete " + resource
end
end
+#=end
end