Skip to content

Commit

Permalink
add more fit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Kadurin committed Apr 23, 2020
1 parent bcd5247 commit 543eac1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_baselines.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from moses.baselines import CombinatorialGenerator
from moses.baselines import NGram
from moses.baselines import HMM
from moses.metrics.utils import fragmenter


class test_baselines(unittest.TestCase):
Expand All @@ -28,6 +29,17 @@ def test_hmm(self):
)

def test_combinatorial(self):
self.assertEqual(
self.train[0],
'CCCS(=O)c1ccc2[nH]c(=NC(=O)OC)[nH]c2c1',
"Train set is different: %s" % self.train[0]
)
fragments = fragmenter('CCCS(=O)c1ccc2[nH]c(=NC(=O)OC)[nH]c2c1')
self.assertEqual(
fragments,
['[1*]C(=O)N=c1[nH]c2ccc(S(=O)CCC)cc2[nH]1', '[3*]OC'],
"Fragmenter is not working properly: %s" % str(fragments)
)
model = CombinatorialGenerator()
model.fit(self.train[:100])
self.assertEqual(
Expand Down

0 comments on commit 543eac1

Please sign in to comment.