コード例 #1
0
ファイル: test_wsmatrix.py プロジェクト: samtaufa/wordsearch
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)
コード例 #2
0
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)
コード例 #3
0
 def test_load(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     lines = test.load(fh)
     assert lines
コード例 #4
0
 def test_open(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     assert fh
コード例 #5
0
 def test_open(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     assert file == type(fh)
     assert self.filename == fh.name
コード例 #6
0
 def test_load(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     lines = test.load(fh)
     assert lines
コード例 #7
0
 def test_open(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     assert fh
コード例 #8
0
 def test_open(self):
     test = WSstreamIO()
     fh = test.open(self.filename)
     assert file == type(fh)
     assert self.filename == fh.name