Remove duplicate test

pull/184/head
Chip Senkbeil 1 year ago
parent 291d04954b
commit 0dcad7f856
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -2307,63 +2307,6 @@ mod tests {
assert!(permissions.readonly(), "File not set to readonly");
}
#[test(tokio::test)]
async fn set_permissions_should_support_following_symlinks_if_option_specified() {
let (api, ctx, _rx) = setup(1).await;
let temp = assert_fs::TempDir::new().unwrap();
let file = temp.child("file");
file.write_str("some text").unwrap();
let symlink = temp.child("link");
symlink.symlink_to_file(file.path()).unwrap();
// Verify that file is not readonly by default
let permissions = tokio::fs::symlink_metadata(file.path())
.await
.unwrap()
.permissions();
assert!(!permissions.readonly(), "File is already set to readonly");
// Verify that symlink is not readonly by default
let permissions = tokio::fs::symlink_metadata(symlink.path())
.await
.unwrap()
.permissions();
assert!(
!permissions.readonly(),
"Symlink is already set to readonly"
);
// Change the permissions of the file pointed to by the symlink
api.set_permissions(
ctx,
symlink.path().to_path_buf(),
Permissions::readonly(),
SetPermissionsOptions {
follow_symlinks: true,
..Default::default()
},
)
.await
.unwrap();
// Retrieve permissions of the file and symlink to verify set
let permissions = tokio::fs::symlink_metadata(file.path())
.await
.unwrap()
.permissions();
assert!(permissions.readonly(), "File not set to readonly");
let permissions = tokio::fs::symlink_metadata(symlink.path())
.await
.unwrap()
.permissions();
assert!(
!permissions.readonly(),
"Symlink unexpectedly set to readonly"
);
}
// NOTE: Ignoring on windows because it's using WSL which wants a Linux path
// with / but thinks it's on windows and is providing \
#[test(tokio::test)]

Loading…
Cancel
Save