You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
853 B

import pytest
import tool_helper
import tests.helper as helper
def test_tool_function_decorator_if_clean_tool_list():
""" tests for the tool list to be empty. NOT strictly nessesary,
but I want to be warned if this is not the case anymore. Could be not the intention """
start_len = len(tool_helper.tool_list)
assert start_len == 0
def test_tool_function_decorator():
# get length before adding tools
start_len = len(tool_helper.tool_list)
# add tools like it would be a decorator
tool_helper.tool(helper.tool_dummy)
tool_helper.tool(helper.tool_dummy2)
# get length after adding tools
end_len = len(tool_helper.tool_list)
# remove the added ones again
tool_helper.tool_list = tool_helper.tool_list[:-2]
assert end_len == start_len + 2
assert len(tool_helper.tool_list) == start_len