I have a function which dispatches other function depending on file extension in a given path.
def read_file(path: str): condition = function_to_check_condition(path) if condition == 1: return read_1(path) if condition == 2: return read_2(path) if condition == 3: return read_3(path) def read_1(path): file = load_file(path) return file
I want to write unittest to check if it returns the correct function. I can't use assertIsInstance
as it returns file
. So how would I check if it returns call to read_1()
first?
没有评论:
发表评论