def test_zipper(self): assert ListOperations.zipper([1, 2, 3], [2, 5, 3, 7], ["a", "b", "c"], fillvalue=None) == [ [1, 2, "a"], [2, 5, "b"], [3, 3, "c"], [None, 7, None], ]
def test_has_duplicates(self, array, result): assert ListOperations.has_duplicates(array) is result
def test_groupby(self, array, func, result): assert ListOperations.group_by(array, func) == result
def test_all_unique_fails(self, args, error): with pytest.raises(error): ListOperations.all_unique(args)
def test_union_by_fails(self, array1, array2, func, error): with pytest.raises(error): ListOperations.union_by(array1, array2, func)
def test_symmetric_difference_by_fails(self, array1, array2, func, error): with pytest.raises(error): ListOperations.symmetric_difference_by(array1, array2, func)
def test_spread(self, array, result): assert ListOperations.spread(array) == result
def test_sanitize(self, input_list, result): assert ListOperations.sanitize_list(input_list) == result
def test_chunk_list(self, array, size, result): assert ListOperations.chunk_list(array, size) == result
def test_bifurcate_by(self, inputs, func, results): assert ListOperations.bifurcate_by(inputs, func) == results
def test_bifurcate_fails(self, inputs, filters, error): with pytest.raises(error): ListOperations.bifurcate(inputs, filters)
def test_bifurcate(self, inputs, filters, results): assert ListOperations.bifurcate(inputs, filters) == results
def test_average_by_fails(self, inputs, error): with pytest.raises(error): ListOperations.average_by(inputs)
def test_average_by(self, inputs, function, result): assert ListOperations.average_by(sequence=inputs, function=function) == result
def test_has_duplicates_fails(self, array, error): with pytest.raises(error): ListOperations.has_duplicates(array)
def test_sample(self, args): assert ListOperations.sample(args) in args
def test_chunk_list_fails(self, array, size, error): with pytest.raises(error): ListOperations.chunk_list(array, size)
def test_shuffle_list(self, array): shuffled = ListOperations.shuffle(array) assert shuffled != array and set(shuffled) == set(array)
def test_deep_flatten(self, args, result): assert ListOperations.deep_flatten(args) == result
def test_symmetric_difference_by(self, array1, array2, func, result): assert ListOperations.symmetric_difference_by(array1, array2, func) == result
def test_eval_some(self, array, func, result): assert ListOperations.eval_some(array, func) is result
def test_union_by(self, array1, array2, func, result): assert ListOperations.union_by(array1, array2, func) == result
def test_get_indices(self, element, array, result): assert ListOperations.get_indices(element, array) == result
def test_get_indices_fails(self, element, array, error): with pytest.raises(error): ListOperations.get_indices(element, array)
def test_all_unique(self, args, result): assert ListOperations.all_unique(args) is result