def test_words(self): v = WordTypeQuantities.WordQuantity() cases = { """I was nervous because I had never been in a strip club before, it was like entering a building where people danced on poles for money; it was exactly that type of place.""": 33, """Perhaps there are aliens on Mars, we will only truly know when we ask.""": 14, """Things that seem bad always maybe appear to be worse""": 10 } for (words, count) in cases.items(): d = Data(words, True) assert (v.build(d) == count) d = Data(words, False) assert (v.build(d) == count)
def test_empty(self): v = WordTypeQuantities.WordQuantity() d = Data("", True) assert (v.build(d) == 0) d = Data("", False) assert (v.build(d) == 0)