forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests_distance_algo.py
59 lines (47 loc) · 2.07 KB
/
tests_distance_algo.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
import unittest
import hedy
class TestsHelperFunctions(unittest.TestCase):
def test_empty_command(self):
invalid_command = ""
closest = hedy.closest_command(invalid_command, ['ask', 'print', 'echo'])
self.assertEqual('ask', closest)
def test_self_command_print(self):
invalid_command = "print"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual(None, closest)
def test_self_command_ask(self):
invalid_command = "ask"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual(None, closest)
def test_self_command_echo(self):
invalid_command = "echo"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual(None, closest)
def test_print_command_1(self):
invalid_command = "printechoask"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual("print", closest)
def test_print_command_2(self):
invalid_command = "printaskecho"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual("print", closest)
def test_echo_command_1(self):
invalid_command = "echoprintask"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual("echo", closest)
def test_echo_command_2(self):
invalid_command = "echoprint ask"
closest = hedy.closest_command(invalid_command, ['print', 'ask', 'echo'])
self.assertEqual("echo", closest)
def test_echo_command_3(self):
invalid_command = "echo print ask"
closest = hedy.closest_command(invalid_command, ['ask', 'print', 'echo'])
self.assertEqual("echo", closest)
def test_ask_command_1(self):
invalid_command = "hello ask echoprint"
closest = hedy.closest_command(invalid_command, ['ask', 'print', 'echo'])
self.assertEqual("ask", closest)
def test_echo_command_4(self):
invalid_command = "hello Ask echo0 print"
closest = hedy.closest_command(invalid_command, ['ask', 'print', 'echo'])
self.assertEqual("echo", closest)