added tests for the path function

This commit is contained in:
2025-10-03 09:48:36 +02:00
parent fb4e8a3be6
commit aa5041a46c

View File

@@ -1,4 +1,5 @@
from src.modules.librefit import ( from src.modules.librefit import (
get_current_path,
get_standard_folder_name, get_standard_folder_name,
get_standard_name_number, get_standard_name_number,
get_standard_file_name, get_standard_file_name,
@@ -42,3 +43,18 @@ def test_folder_name_list():
folder_names = ["folder1", "folder2", "folder3"] folder_names = ["folder1", "folder2", "folder3"]
return_folder_name = get_standard_folder_name(folder_names) return_folder_name = get_standard_folder_name(folder_names)
assert "folder1" in return_folder_name 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