sh_cpl/unittests/unittests_query/iterable_test_case.py

22 lines
504 B
Python
Raw Normal View History

2021-07-26 15:48:42 +02:00
import unittest
from cpl_query.extension.list import List
2022-05-26 15:53:23 +02:00
class IterableTestCase(unittest.TestCase):
2021-07-26 15:48:42 +02:00
def setUp(self) -> None:
self._list = List(int)
def _clear(self):
self._list.clear()
self.assertEqual(self._list, [])
def test_append(self):
self._list.append(1)
self._list.append(2)
self._list.append(3)
2022-09-13 19:33:26 +02:00
self.assertEqual(self._list.to_list(), [1, 2, 3])
2021-07-26 15:48:42 +02:00
self.assertRaises(Exception, lambda v: self._list.append(v), '3')