Example #1
0
    def test_should_fail_when_inserting_items(self):
        # given
        oktypes = (int,)
        lst = TypedList(oktypes)

        # then
        with pytest.raises(TypeError) as _:
            lst.insert(0, "1")
Example #2
0
    def test_should_insert_items(self):
        # given
        oktypes = (int,)
        lst = TypedList(oktypes)

        # when
        lst.insert(0, 1)
        lst.insert(1, 2)

        # then
        assert len(lst) == 2