-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands_test.py
107 lines (92 loc) · 3.75 KB
/
commands_test.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
from SpeechRecognition_test import NLP
class TestCase:
def __init__(self, _nlp, _command):
self.nlp = _nlp
self.command = _command
self.passed = False
self.nlp.annunciate(_command)
self.execute_test()
def execute_test(self):
self.nlp.parse_command(self.command, True)
def main():
test_nlp = NLP()
choice = ""
while choice != "X":
print "Run a group of tests:"
print " A: Temp"
print " B: Weight"
print " C: Timer"
print " D: Recipe"
print " E: Misc"
print " *: Run all"
print " F: Voice trial"
print " G: Multithread voice trial"
print " X: Exit"
choice = raw_input("Selection: ")
if choice == "*":
run_all = True
else:
run_all = False
if choice == "A" or run_all:
# ------- TEMPERATURE ------- #
test_value = 45
test_nlp.chef.set_temp([test_value, " degrees F"])
temp_tests = ["What is the oven temperature",
"How hot is the dish",
"Where's my heat at",
"What's the temperature"]
for test_case in temp_tests:
TestCase(test_nlp, test_case)
elif choice == "B" or run_all:
# ------- WEIGHT ------- #
test_value = 15
test_nlp.chef.set_weight([test_value, " oz"])
weight_tests = ["What is the dish weight",
"How heavy is the dish"]
for test_case in weight_tests:
TestCase(test_nlp, test_case)
elif choice == "C" or run_all:
# ------- TIMER ------- #
set_timer_tests = ["Set alarm for 3 o'clock",
"Set alarm for 2:30",
"Set alarm for 10:14",
"Set timer for 3 hours and 45 minutes",
"Set timer for 2 and a half hours and 80 minutes",
"Set timer for seconds and three quarters minutes",
"Set timer for minutes",
"Set timer for hours",
"Set timer"
]
for test_case in set_timer_tests:
TestCase(test_nlp, test_case)
read_timer_tests = ["How much time is left",
"When will my dish be done",
"What time will my dish finish",
"What is the timer at"]
for test_case in read_timer_tests:
TestCase(test_nlp, test_case)
elif choice == "D" or run_all:
# ------- RECIPE ------- #
recipe_tests = ["Next step",
"Move to next step",
"Go to next step",
"What is the next step",
"Last step",
"Previous step",
"What do I need",
"What utensils do I need"]
for test_case in recipe_tests:
TestCase(test_nlp, test_case)
elif choice == "E" or run_all:
# ------- MISCELLANEOUS ------- #
misc_tests = ["Help me",
"How do you cook spaghetti",
"Find a video",
"What's the difference between sliced and chopped"]
for test_case in misc_tests:
TestCase(test_nlp, test_case)
elif choice == "F":
test_nlp.run_nlp()
elif choice == "G":
test_nlp.run_NLP_multithread()
main()