class MaxSizeListTest(unittest.TestCase): def setUp(self): self.a = MaxSizeList(3) self.b = MaxSizeList(1) def test_stores_1_elements(self): self.a.push("hey") self.assertEqual(["hey"], self.a.get_list()) def test_stores_only_till_limit(self): self.a.push("hey") self.a.push("hi") self.a.push("lets") self.a.push("go") self.assertEqual(["hi", "lets", "go"], self.a.get_list())
from assignments import MaxSizeList a = MaxSizeList(3) b = MaxSizeList(1) a.push("hey") a.push("hi") a.push("let's") a.push("go") b.push("hey") b.push("hi") b.push("let's") b.push("go") print(a.get_list()) #print(a.get_size()) print(b.get_list())
from assignments import MaxSizeList a = MaxSizeList(3) b = MaxSizeList(1) a.push("hey") a.push("hi") a.push("let's") a.push("go") b.push("hey") b.push("hi") b.push("let's") b.push("go") print(a.get_list()) print(b.get_list())
"""This script imports the assignments and checks them""" from assignments import MaxSizeList # Calling assignment 01 A = MaxSizeList(2) A.push("gog") A.push("dog") A.push("hog") print A.get_list()
from assignments import MaxSizeList a = MaxSizeList(1) b = MaxSizeList(3) a.push('hey') a.push('hi') a.push('let') a.push('go') b.push('hey') b.push('hi') b.push('let') b.push('go') print(a.get_list()) # ['go'] print(b.get_list()) # ['hi', 'let', 'go']