travis-ci
12906 of 13175 relevant lines covered (97.96%)
1.47 hits per line
1 |
from unittest.case import TestCase |
1 only TOX_ENV=單元試驗 ✔ |
2 |
from 臺灣言語工具.解析整理.拆文分析器 import 拆文分析器 |
1 only TOX_ENV=單元試驗 ✔ |
3 |
from 臺灣言語工具.解析整理.型態錯誤 import 型態錯誤 |
1 only TOX_ENV=單元試驗 ✔ |
4 |
from 臺灣言語工具.基本物件.句 import 句 |
1 only TOX_ENV=單元試驗 ✔ |
5 |
|
|
6 |
|
|
7 |
class 句單元試驗(TestCase): |
1 only TOX_ENV=單元試驗 ✔ |
8 |
|
|
9 |
def test_句烏白傳(self): |
1 only TOX_ENV=單元試驗 ✔ |
10 |
self.assertRaises(型態錯誤, 句, None) |
1 only TOX_ENV=單元試驗 ✔ |
11 |
self.assertRaises(型態錯誤, 句, [None]) |
1 only TOX_ENV=單元試驗 ✔ |
12 |
self.assertRaises(型態錯誤, 句, ['sui2']) |
1 only TOX_ENV=單元試驗 ✔ |
13 |
|
|
14 |
def test_看句(self): |
1 only TOX_ENV=單元試驗 ✔ |
15 |
型 = '恁老母ti3佗位'
|
1 only TOX_ENV=單元試驗 ✔ |
16 |
音 = 'lin1 lau3 bu2 ti3 to1 ui7'
|
1 only TOX_ENV=單元試驗 ✔ |
17 |
句物件 = 拆文分析器.對齊句物件(型, 音) |
1 only TOX_ENV=單元試驗 ✔ |
18 |
self.assertEqual(句物件.看型(), 型)
|
1 only TOX_ENV=單元試驗 ✔ |
19 |
self.assertEqual(句物件.看音(), 音)
|
1 only TOX_ENV=單元試驗 ✔ |
20 |
分詞 = '恁|lin1 老|lau3 母|bu2 ti3|ti3 佗|to1 位|ui7'
|
1 only TOX_ENV=單元試驗 ✔ |
21 |
self.assertEqual(句物件.看分詞(), 分詞)
|
1 only TOX_ENV=單元試驗 ✔ |