-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_main.py
30 lines (21 loc) · 980 Bytes
/
test_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest
from main import processcommand
class TestMain(unittest.TestCase):
def test_open_website(self):
result = processcommand("open google")
self.assertTrue("Opening google" in result or "Artificial Intelligence" in result)
def test_search(self):
result = processcommand("search LOL on google")
self.assertTrue("Searching for lol" in result or "Artificial Intelligence" in result)
def test_define_word(self):
result = processcommand("define artificial intelligence")
self.assertTrue("artificial intelligence is defined as .." in result or "Artificial Intelligence" in
result)
def test_news(self):
result = processcommand("news")
self.assertIn("Here are the top news headlines", result)
def test_AI(self):
result = processcommand("Hello AI")
self.assertTrue("Artificial Intelligence", result)
if __name__ == '__main__':
unittest.main()