def test_get_next_end_of_items(): p = PreviousArray() assert p.get_next() is None
def test_get_next_one_item_in_list(): p = PreviousArray() p.append('apple') assert p.get_next() == 'apple'
def prev(): p = PreviousArray() p.append("one") p.append("two") p.append("three") yield p
def test_empty_item_list_get_first_returns_none(): p = PreviousArray() assert p.get_first() is None
def test_get_previous_two_items(): p = PreviousArray() p.append("one") p.append("two") assert p.get_previous() == 'one'
def test_get_previous_one_item(): p = PreviousArray() p.append("one") assert p.get_previous() == 'one'
def test_get_previous_no_items(): p = PreviousArray() assert p.get_previous() is None
def test_append(): p = PreviousArray() p.append("hello") assert len(p.items) == 1 assert p.items[0] == 'hello'
def test_initialize(): p = PreviousArray() assert p.prev_index is None assert len(p.items) == 0