<reponame>acse-zh820/ci_acse1
import pytest

from simple_functions import my_sum, factorial, average


class TestSimpleFunctions(object):
    '''Class to test our simple functions are working correctly'''

    @pytest.mark.parametrize('iterable, expected', [
        ([8, 7, 5], 20),
        ((10, -2, 5, -10, 1), 4)
    ])
    def test_my_add(self, iterable, expected):
        '''Test our add function'''
        isum = my_sum(iterable)
        assert isum == expected

    @pytest.mark.parametrize('number, expected', [
        (5, 120),
        (3, 6),
        (1, 1)
    ])
    def test_factorial(self, number, expected):
        '''Test our factorial function'''
        answer = factorial(number)
        assert answer == expected

    @pytest.mark.parametrize('n, expected', [
        ([1, 2, 3], 2),
        ([4, 6, 8], 6)
    ])
    def test_average(self, n, expected):
        result = average(n)
        assert result == expected

import pytest

from simple_functions import my_sum, factorial, average


class TestSimpleFunctions(object):
    '''Class to test our simple functions are working correctly'''

    @pytest.mark.parametrize('iterable, expected', [
        ([8, 7, 5], 20),
        ((10, -2, 5, -10, 1), 4)
    ])
    def test_my_add(self, iterable, expected):
        '''Test our add function'''
        isum = my_sum(iterable)
        assert isum == expected

    @pytest.mark.parametrize('number, expected', [
        (5, 120),
        (3, 6),
        (1, 1)
    ])
    def test_factorial(self, number, expected):
        '''Test our factorial function'''
        answer = factorial(number)
        assert answer == expected

    @pytest.mark.parametrize('n, expected', [
        ([1, 2, 3], 2),
        ([4, 6, 8], 6)
    ])
    def test_average(self, n, expected):
        result = average(n)
        assert result == expected
Class to test our simple functions are working correctly Test our add function Test our factorial function