Beispiel #1
0
 def test_init_negative(self):
     with self.assertRaises(ValueError):
         LimitedList(upper_limit=-3)
Beispiel #2
0
 def test_pop(self):
     limited_list: LimitedList[int] = LimitedList([i for i in range(3)],
                                                  lower_limit=3)
     with self.assertRaises(OverflowError):
         limited_list.pop(1)
Beispiel #3
0
 def test_extend(self):
     limited_list: LimitedList[int] = LimitedList([i for i in range(3)],
                                                  upper_limit=3)
     with self.assertRaises(OverflowError):
         limited_list.extend([3])
Beispiel #4
0
 def test_insert(self):
     limited_list: LimitedList[int] = LimitedList([1, 2, 4], upper_limit=3)
     with self.assertRaises(OverflowError):
         limited_list.insert(2, [3])
Beispiel #5
0
 def test_init_too_small(self):
     with self.assertRaises(OverflowError):
         LimitedList([i for i in range(4)], lower_limit=5)
Beispiel #6
0
 def test_init_too_big(self):
     with self.assertRaises(OverflowError):
         LimitedList([i for i in range(4)], upper_limit=3)