From 56db4da2f4e8c78fa67ba7e72390e267655a0cd1 Mon Sep 17 00:00:00 2001 From: Matthew Newville Date: Sun, 17 Nov 2024 22:27:05 -0600 Subject: [PATCH] more basic tests of utilities --- tests/test_pyshortcuts.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_pyshortcuts.py b/tests/test_pyshortcuts.py index 6bb6168..ba2e662 100644 --- a/tests/test_pyshortcuts.py +++ b/tests/test_pyshortcuts.py @@ -11,15 +11,12 @@ import pytest from pyshortcuts import (make_shortcut, platform, Shortcut, get_folders, - fix_filename, fix_varname, gformat, isotime) - + fix_filename, fix_varname, gformat, isotime, + get_homedir, get_desktop) folders = get_folders() root = Path(__file__).parent.parent.as_posix() -print("Root ", root) - - def test_shortcut(): '''Create a shortcut from examples dir''' print('---test_shortcut()') @@ -52,6 +49,11 @@ def test_empty_string_script(): cmd = "" scut = make_shortcut(cmd, name="My Script is empty string") +def test_get_homedir(): + assert len(get_homedir()) > 2 + +def test_get_desktop(): + assert len(get_desktop()) > len(get_homedir()) def test_fix_filename(): assert 'a_file_.txt' == fix_filename('a file#.txt') @@ -92,5 +94,7 @@ def test_gformat(): test_none_script() test_empty_string_script() test_fix_filename() + test_get_homedir() + test_get_desktop() test_isotime() test_gformat()