Skip to content

Commit

Permalink
chg: dev: fefactor platform_check, remove a branch, adjust test assert
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
  • Loading branch information
sarnold committed Dec 15, 2024
1 parent df48d68 commit fa6f2a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/pyserv/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ def init_dirs(dirs):
usr_path.mkdir(parents=True, exist_ok=True)


def platform_check():
def platform_check() -> bool:
"""
Check to see if we think we are POSIX.
:return list: valid platform name
:return we_are_posix: true if system is posix
"""
valid_os = []
myname = sys.platform
is_posix = os.name == 'posix'
posix_list = [
Expand All @@ -52,9 +51,8 @@ def platform_check():
'openbsd',
'freebsd',
]
valid_os = [x for x in posix_list if x in myname and is_posix]

return valid_os
we_are_posix = myname in posix_list and is_posix
return we_are_posix


def show_uservars():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_get_userdirs():
else:
assert logdir.name == 'log'

assert piddir.name == 'pyserv'
assert piddir.name == 'pyserv' or 'Cache'
assert docdir.name == Path.cwd().name


Expand Down

0 comments on commit fa6f2a8

Please sign in to comment.