From aa5041a46cb2a1a2383eb2205cb52407348c8aa6 Mon Sep 17 00:00:00 2001 From: cerberus Date: Fri, 3 Oct 2025 09:48:36 +0200 Subject: [PATCH] added tests for the path function --- refit/test_librefit.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/refit/test_librefit.py b/refit/test_librefit.py index 2276fc7..efa8e43 100644 --- a/refit/test_librefit.py +++ b/refit/test_librefit.py @@ -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