示例#1
0
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
示例#2
0
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
示例#3
0
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
示例#4
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
示例#5
0
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
示例#6
0
def test_check_if_exists():
    # check if file exists = true
    assert nyx.check_if_path_exists(filepath_with_name)
示例#7
0
def check_if_file_exists(filepath):
    # check if file exists = true
    yield
    return nyx.check_if_path_exists(filepath)
示例#8
0
def open_file(filepath):
    # set-up function - open file
    return nyx.open_file(filepath)
示例#9
0
def test_calc():
    assert nyx.calc(1) > 0