diff options
Diffstat (limited to 'test/loael-mazzatorta.rb')
-rw-r--r-- | test/loael-mazzatorta.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/loael-mazzatorta.rb b/test/loael-mazzatorta.rb new file mode 100644 index 0000000..acb5aac --- /dev/null +++ b/test/loael-mazzatorta.rb @@ -0,0 +1,32 @@ +require 'minitest/autorun' +#require 'toxtree' +require_relative '../lib/loael-mazzatorta.rb' + +class LoaelTest < MiniTest::Test + + def test_loael_single + assert_equal 1.84196, LoaelMazzatorta.predict("c1ccccc1NN")["value"].round(5) + end + def test_loael_batch + smiles = [] + values = [] + lines = File.open("smiles.csv").readlines + lines.shift + lines.each do |line| + smi,v = line.chomp.split(",") + smiles << smi + values << v.to_f + end + predictions = LoaelMazzatorta.predict(smiles)#.collect{|p| p["value"]} + predictions.each_with_index do |p,i| + if p["value"] + assert_equal p["value"].round(5), values[i].round(5) + else + assert p["warnings"] + end + end + + end + +end + |