def test_push_back_in_empty_list(): list = LinkedList() list.push_back(10) assert list.size == 1 assert list.is_empty == False assert len(list) == 1
def value_at_fixture(): list = LinkedList() for i in range(10): list.push_back(i) return list
def search_fixture(): list = LinkedList() for i in range(5): list.push_front(i) return list
def test_front(): list = LinkedList() list.push_front(1) assert list.front == 1 assert list.size == 1 assert list.is_empty == False assert len(list) == 1
def test_push_back_using_back(): list = LinkedList() list.back = 1 assert list.front == 1 assert list.back == 1 assert list.size == 1 assert list.is_empty == False assert len(list) == 1
def test_back_and_push(): list = LinkedList() list.push_back(11) assert list.back == 11 assert list.front == 11 assert list.size == 1 assert list.is_empty == False assert len(list) == 1
def test_change_front_element(): list = LinkedList() for i in range(5): list.push_front(i) assert list.front == 4 assert list.back == 0 list.front = 100 assert list.front == 100 assert list.back == 0
def test_make_list(): list = LinkedList() assert list.size == 0 assert list.is_empty == True assert len(list) == 0
def test_back_from_empty(): list = LinkedList() with pytest.raises(CollectionIsEmptyExeption) as exception_info: value = list.back assert str(exception_info.value) == list_is_empty()
def test_remove_from_empty_list(): list = LinkedList() assert list.remove_value(100) is False
def test_pop_front_negative(value_at_fixture): list = LinkedList() with pytest.raises(CollectionIsEmptyExeption) as exception_info: value = list.pop_back() assert str(exception_info.value) == list_is_empty()
def test_value_at_empty_list(): list = LinkedList() with pytest.raises(CollectionIsEmptyExeption) as exception_info: value = list.value_at(list.size) assert str(exception_info.value) == list_is_empty()
def test_search_in_empty_list_using_in(): list = LinkedList() assert (10 in list) == False
def test_search_in_empty_list(): list = LinkedList() assert list.contains(10) == False