def test_function_series2():

    class my_function2(Function):

        def fdiff(self, argindex=1):
            return -sin(self.args[0])

        @classmethod
        def eval(cls, arg):
            arg = sympify(arg)
            if arg == 0:
                return sympify(1)

    #Test that the taylor series is correct
    assert my_function2(x).series(x, 0, 10) == cos(x).series(x, 0, 10)
Create our new "cos" function.
dataset/ETHPy150Open sympy/sympy/sympy/functions/elementary/tests/test_interface.py/test_function_series2