-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
25 lines (16 loc) · 758 Bytes
/
tests.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
import unittest
from shopping_list import ShoppingList
class ShoppingListTestCase(unittest.TestCase):
def setUp(self):
self.myList = ShoppingList()
def test_items(self):
self.assertEqual(self.myList.myList, [], msg='item not in list')
def test_add_items(self):
self.myList.add_items('lotion')
self.assertEqual(self.myList.myList, ['lotion'], msg='item not added to list')
def test_add_more_items(self):
self.myList.add_more_items('perfume')
self.assertEqual(self.myList.myList, ['perfume'], msg='item not not on list')
def test_remove_item(self):
self.myList.remove_item("perfume")
self.assertEqual(self.myList.myList, ['perfume'], msg="Item not deleted")