class u_WSlang(libpry.AutoTree): def setUpAll(self): self.wsstreamio = WSstreamIO() self.wstext = WStext() self.wstext.setLanguage('to') fh = self.wsstreamio.open('unicode.txt') self.wsstreamio.load(fh) self.lines = self.wsstreamio.lines self.originalEncoding = self.wsstreamio.originalEncoding def test_loadfile(self): self.wstext.setWordlist(self.lines) lineswordcount = 0 for line in self.lines: for word in line: lineswordcount += 1 assert lineswordcount > len(self.wstext.wordlist)
def test_load(self): test = WSstreamIO() fh = test.open(self.filename) lines = test.load(fh) assert lines
def test_open(self): test = WSstreamIO() fh = test.open(self.filename) assert fh
def test_open(self): test = WSstreamIO() fh = test.open(self.filename) assert file == type(fh) assert self.filename == fh.name