added tests for the path function
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from src.modules.librefit import (
|
||||
get_current_path,
|
||||
get_standard_folder_name,
|
||||
get_standard_name_number,
|
||||
get_standard_file_name,
|
||||
@@ -42,3 +43,18 @@ def test_folder_name_list():
|
||||
folder_names = ["folder1", "folder2", "folder3"]
|
||||
return_folder_name = get_standard_folder_name(folder_names)
|
||||
assert "folder1" in return_folder_name
|
||||
|
||||
|
||||
def test_get_current_directory():
|
||||
"""Tests if the directory is set to the current directory, if None
|
||||
is passed with the argument"""
|
||||
path = None
|
||||
directory = get_current_path(path)
|
||||
assert "." in directory
|
||||
|
||||
|
||||
def test_for_existing_path():
|
||||
"""Tests if the function returns the correct path."""
|
||||
path = "/home/cerberus/Documents/books/"
|
||||
directory = get_current_path(path)
|
||||
assert "/home/cerberus/Documents/books/" in directory
|
||||
|
||||
Reference in New Issue
Block a user