wenima / data-structures

used for all data structure assignments
1 stars 0 forks source link

on branch dll in test_dbl_linked_list - parametrize the input into functions and parametrize fixtures #40

Open wenima opened 7 years ago

wenima commented 7 years ago

so right now we have something like this:

def test_create_dbl_with_iterable():
    """Given an iterable, test that new Dbl_LL is created."""
    from dbl_linked_list import Dbl_Linked_List
    new_dll = Dbl_Linked_List(TEST_ITER)
    assert new_dll.head.value == 5
    assert new_dll.tail.value == 1

the idea would be to not have a hardcoded number but rather extract that number from a parametrization which contains the iterable we are using here. Otherwise changing the iterable will break the tests and it's always bad to hardcode things.