def test_find_last_modified_between_two_files(): # 3 files exist and are last modified at the same time two_modified = nyx.find_last_modified(filepath_two_modified) assert nyx.check_if_path_exists(two_modified) # find true to pass
def test_find_file_by_dir(): nyx.find_file_by_dir(filepath_3_files, filetype1) assert nyx.check_if_path_exists(filepath_3_files) # find true to pass
def test_find_word_in_txt(): occurrences = nyx.find_word_in_txt(filepath_with_name, word) assert occurrences > 0 # count if number of words is larger than 0
def test_find_last_modified(): modified = nyx.find_last_modified(filepath_3_files) assert nyx.check_if_path_exists(modified) # find true to pass
def test_fail_to_check_if_file_exists(open_file): # fail checking file exists on purpose assert nyx.check_if_path_exists(filepath_wrong_name) == True
def test_check_if_exists(): # check if file exists = true assert nyx.check_if_path_exists(filepath_with_name)
def check_if_file_exists(filepath): # check if file exists = true yield return nyx.check_if_path_exists(filepath)
def open_file(filepath): # set-up function - open file return nyx.open_file(filepath)
def test_calc(): assert nyx.calc(1) > 0