Skip to content

Commit

Permalink
clean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcmarrow committed Oct 12, 2023
1 parent 6d14285 commit f67d9ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/pytests/functional/modules/test_win_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,19 @@ def test_mode(tmp_path):
def test_lchown(tmp_path, windows_user):
path = str(tmp_path)
assert win_file.lchown(path, windows_user) is True
assert win_file.get_user(path) == windows_user


def test_chown(tmp_path, windows_user):
path = str(tmp_path)
assert win_file.chown(path, windows_user) is True
assert win_file.get_user(path) == windows_user


def test_chpgrp(tmp_path):
tmp_path = str(tmp_path)
assert win_file.chpgrp(tmp_path, "Administrators") is True
assert win_file.get_pgroup(tmp_path) == "Administrators"


def test_chgrp(tmp_path):
Expand Down Expand Up @@ -267,6 +270,7 @@ def test_remove(tmp_path):
pass
assert os.path.isfile(file) is True
assert win_file.remove(file) is True
assert os.path.isfile(file) is False


def test_remove_force(tmp_path):
Expand All @@ -276,6 +280,7 @@ def test_remove_force(tmp_path):
pass
assert os.path.isfile(file) is True
assert win_file.remove(file, force=True) is True
assert os.path.isfile(file) is False


def test_mkdir(tmp_path):
Expand Down Expand Up @@ -304,10 +309,14 @@ def test_makedirs_perms(tmp_path):
def test_check_perms(tmp_path, windows_user):
path = str(tmp_path)
ret = {}
assert isinstance(win_file.check_perms(path, ret, windows_user), dict)
perms = win_file.check_perms(path, ret, windows_user)
assert ret == {}
assert perms["comment"] == ""
assert isinstance(perms["changes"], dict)
assert isinstance(perms["name"], str) and len(perms["name"])
assert perms["result"] is True


def test_set_perms(tmp_path):
path = str(tmp_path)
assert isinstance(win_file.check_perms(path), dict)
assert win_file.set_perms(path) == {}

0 comments on commit f67d9ae

Please sign in to comment.