Skip to content

Commit

Permalink
more basic tests of utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Nov 18, 2024
1 parent 63eded1 commit 56db4da
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/test_pyshortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()')
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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()

0 comments on commit 56db4da

Please sign in to comment.