@@ -23,22 +23,42 @@ def test_cli_main(self):
2323
2424 def test_cli_data (self ):
2525 self .assertIsInstance (getattr (cli , "data" ), ModuleType )
26+
27+ with self .assertRaises (SystemExit ) as ex :
28+ cli .data .App (["thainlp" , "data" ])
29+ self .assertEqual (ex .exception .code , 2 )
30+
2631 self .assertIsNotNone (cli .data .App (["thainlp" , "data" , "catalog" ]))
2732 self .assertIsNotNone (cli .data .App (["thainlp" , "data" , "path" ]))
33+ self .assertIsNotNone (cli .data .App (["thainlp" , "data" , "get" , "test" ]))
2834 self .assertIsNotNone (cli .data .App (["thainlp" , "data" , "info" , "test" ]))
35+ self .assertIsNotNone (cli .data .App (["thainlp" , "data" , "rm" , "test" ]))
2936 self .assertIsNotNone (
3037 cli .data .App (["thainlp" , "data" , "get" , "NOT_EXIST" ])
3138 )
39+ self .assertIsNotNone (
40+ cli .data .App (["thainlp" , "data" , "info" , "NOT_EXIST" ])
41+ )
3242 self .assertIsNotNone (
3343 cli .data .App (["thainlp" , "data" , "rm" , "NOT_EXIST" ])
3444 )
3545
3646 def test_cli_soundex (self ):
3747 self .assertIsInstance (getattr (cli , "soundex" ), ModuleType )
48+
49+ with self .assertRaises (SystemExit ) as ex :
50+ cli .data .App (["thainlp" , "soundex" ])
51+ self .assertEqual (ex .exception .code , 2 )
52+
3853 self .assertIsNotNone (cli .soundex .App (["thainlp" , "soundex" , "ทดสอบ" ]))
3954
4055 def test_cli_tag (self ):
4156 self .assertIsInstance (getattr (cli , "tag" ), ModuleType )
57+
58+ with self .assertRaises (SystemExit ) as ex :
59+ cli .data .App (["thainlp" , "tag" ])
60+ self .assertEqual (ex .exception .code , 2 )
61+
4262 self .assertIsNotNone (
4363 cli .tag .App (
4464 [
@@ -65,7 +85,17 @@ def test_cli_tag(self):
6585 )
6686
6787 def test_cli_tokenize (self ):
68- self .assertIsInstance (getattr (cli , "data" ), ModuleType )
88+ self .assertIsInstance (getattr (cli , "tokenize" ), ModuleType )
89+
90+ with self .assertRaises (SystemExit ) as ex :
91+ cli .data .App (["thainlp" , "tokenize" ])
92+ self .assertEqual (ex .exception .code , 2 )
93+
94+ self .assertIsNotNone (
95+ cli .tokenize .App (
96+ ["thainlp" , "tokenize" , "NOT_EXIST" , "ไม่มีอยู่ จริง" ,]
97+ )
98+ )
6999 self .assertIsNotNone (
70100 cli .tokenize .App (
71101 [
0 commit comments