-
Notifications
You must be signed in to change notification settings - Fork 1
/
unitTest.py
45 lines (27 loc) · 964 Bytes
/
unitTest.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
#!/bin/env python3
import unittest
from decimalMatch import decimalMatch
class TestStringMethods(unittest.TestCase):
def test_book(self):
a = decimalMatch()
a.appendToList("booaa")
a.appendToList("book")
self.assertEqual(set(a.findInList("2151511")), set(['BOOAA', 'BOOK']))
def test_books(self):
a = decimalMatch()
a.appendToList("books")
self.assertEqual(a.findInList("215151119"), ['BOOKS'])
def test_flower(self):
a = decimalMatch()
a.appendToList("FLOWER")
self.assertEqual(a.findInList("6121523518"), ['FLOWER'])
def test_city(self):
a = decimalMatch()
a.appendToList("CiTy")
self.assertEqual(a.findInList("392025"), ['CITY'])
def test_ghfyt(self):
a = decimalMatch()
a.appendToList("Ghfyt")
self.assertEqual(a.findInList("7862520"), ['GHFYT'])
if __name__ == '__main__':
unittest.main()