def test_duplicates(self): x = model.words_with_endings(["a", "b", "b"], ["1", "2"]) self.failUnlessEqual(x, {"a1", "a2", "b1", "b2"})
def test_empty_endings(self): x = model.words_with_endings({"a", "b", "c"}, set()) self.failUnlessEqual(x, {"a", "b", "c"})
def test_empty_both(self): x = model.words_with_endings(set(), set()) self.failUnlessEqual(x, set())
def test_basic(self): words = ['a', 'b', 'ABC'] x = model.words_with_endings(words, {'', 'x', 'XX'}) self.failUnlessEqual(x, {'a', 'ax', 'aXX', 'b', 'bx', 'bXX', 'ABC', 'ABCx', 'ABCXX'})