This is prep for having additional solvers that can be trivially swapped in and out.
28 lines
534 B
Python
28 lines
534 B
Python
#!/usr/bin/python
|
|
|
|
import unittest
|
|
|
|
import solver
|
|
|
|
|
|
class TestSolver(unittest.TestCase):
|
|
def test_SimilaritySolver(self):
|
|
"""Minimal end to end test."""
|
|
|
|
solve = solver.SimilaritySolver()
|
|
result = solve.scored_words()
|
|
|
|
expected = [
|
|
("cares", 139631),
|
|
("sanes", 139129),
|
|
("tares", 138755),
|
|
("bares", 138375),
|
|
("sales", 137491),
|
|
]
|
|
|
|
self.assertListEqual(result[:5], expected)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|