island: Rename create_secure_file tests

create_secure_file() was previously renamed to
get_file_descriptor_for_new_secure_file().
This commit is contained in:
Mike Salvatore 2021-06-15 13:14:31 -04:00
parent 327ff7a626
commit 44bdfa5508
1 changed files with 5 additions and 5 deletions

View File

@ -56,7 +56,7 @@ def _get_acl_and_sid_from_path(path: str):
return acl, sid
def test_create_secure_directory__already_created(test_path):
def test_create_secure_directory__already_exists(test_path):
os.mkdir(test_path)
assert os.path.isdir(test_path)
create_secure_directory(test_path)
@ -95,7 +95,7 @@ def test_create_secure_directory__perm_windows(test_path):
assert permissions == FULL_CONTROL and ace_type == ACE_TYPE_ALLOW
def test_create_secure_file__already_created(test_path):
def test_get_file_descriptor_for_new_secure_file__already_exists(test_path):
os.close(os.open(test_path, os.O_CREAT, stat.S_IRWXU))
assert os.path.isfile(test_path)
@ -103,13 +103,13 @@ def test_create_secure_file__already_created(test_path):
get_file_descriptor_for_new_secure_file(test_path)
def test_create_secure_file__no_parent_dir(test_path_nested):
def test_get_file_descriptor_for_new_secure_file__no_parent_dir(test_path_nested):
with pytest.raises(Exception):
get_file_descriptor_for_new_secure_file(test_path_nested)
@pytest.mark.skipif(is_windows_os(), reason="Tests Posix (not Windows) permissions.")
def test_create_secure_file__perm_linux(test_path):
def test_get_file_descriptor_for_new_secure_file__perm_linux(test_path):
os.close(get_file_descriptor_for_new_secure_file(test_path))
st = os.stat(test_path)
@ -120,7 +120,7 @@ def test_create_secure_file__perm_linux(test_path):
@pytest.mark.skipif(not is_windows_os(), reason="Tests Windows (not Posix) permissions.")
def test_create_secure_file__perm_windows(test_path):
def test_get_file_descriptor_for_new_secure_file__perm_windows(test_path):
win32file.CloseHandle(get_file_descriptor_for_new_secure_file(test_path))
acl, user_sid = _get_acl_and_sid_from_path(test_path)