def test_copy_constructor_diff(): copy_from = MyList("original") copy_to = MyList(copy_from) copy_to.push_front('a') copy_to = get_MyList(copy_to) copy_from = get_MyList(copy_from) assert len(copy_from) == 8 and len(copy_to) == 9
def test_push_front_empty(): test_pf = MyList() for ch in "olleh": test_pf.push_front(ch) assert get_MyList(test_pf) == "hello"
def test_push_front_nonempty(): test_pf = MyList("world") for ch in "olleh": test_pf.push_front(ch) assert get_MyList(test_pf) == "helloworld"