Esempio n. 1
0
 def test_wordslist(self):
     """$ cat /usr/share/dict/words | wc -l
       234936
     
     """
     wlist = findwords.wordslist()
     self.assertEqual(len(wlist), 234936)
Esempio n. 2
0
 def test_wordsfilter(self):
     """$ egrep "^[^aeiouy]{3}$" /usr/share/dict/words
     Aht
     Alb
     Alf
     Ann
     Art
     cwm
     Emm
     grr
     Ind
     Ing
     Mrs
     nth
     Ods
     Odz
     Osc
     pst
     tch
     tck
     tst
     Uds
     
     """
     wlist = findwords.wordsfilter(findwords.wordslist(), self.regex)
     self.assertEqual(len(wlist), 20)
     self.assertEqual(wlist, ["Aht",
                              "Alb",
                              "Alf",
                              "Ann",
                              "Art",
                              "cwm",
                              "Emm",
                              "grr",
                              "Ind",
                              "Ing",
                              "Mrs",
                              "nth",
                              "Ods",
                              "Odz",
                              "Osc",
                              "pst",
                              "tch",
                              "tck",
                              "tst",
                              "Uds"])