def test_append_and_extend(self): items = ItemList(int) items.append(1) items.append(2) items.extend((3, 4)) assert_equal(list(items), [1, 2, 3, 4])
def test_extend_with_generator(self): items = ItemList(str) items.extend((c for c in 'Hello, world!')) assert_equal(list(items), list('Hello, world!'))