-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTestFunnyList3.py
More file actions
29 lines (23 loc) · 825 Bytes
/
TestFunnyList3.py
File metadata and controls
29 lines (23 loc) · 825 Bytes
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
from funnylist import FunnyList
import unittest
class TestFunnyList(unittest.TestCase):
def setUp(self):
# create two standard Python lists
self.list1 = [1, 2, 3]
self.list2 = [3, 2, 1]
# create a combined list of the above
self.clist = self.list1 + self.list2
# create two FunnyLists from the lists
self.fl1 = FunnyList(self.list1)
self.fl2 = FunnyList(self.list2)
def test_equal(self):
'''Check for equality.'''
self.assertTrue(self.fl1 == self.fl2)
def test_add_two(self):
'''Check that adding two FunnyLists together
yields the same result as adding two lists
together.
'''
self.fl3 = self.fl1 + self.fl2
self.assertEqual(self.fl3, self.clist)
unittest.main()