windows: do not skip test when hiding file fails

This commit is contained in:
Šarūnas Nejus 2024-07-16 14:42:35 +01:00
parent 370ae43634
commit c9702a4c24
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
2 changed files with 8 additions and 10 deletions

View file

@ -42,11 +42,12 @@ class FetchartCliTest(unittest.TestCase, TestHelper):
def hide_file_windows(self):
hidden_mask = 2
success = ctypes.windll.kernel32.SetFileAttributesW(
self.cover_path, hidden_mask
self.assertTrue(
ctypes.windll.kernel32.SetFileAttributesW(
self.cover_path, hidden_mask
),
"Could not set file attributes",
)
if not success:
self.skipTest("unable to set file attributes")
def test_set_art_from_folder(self):
self.touch(b"c\xc3\xb6ver.jpg", dir=self.album.path, content="IMAGE")

View file

@ -57,13 +57,10 @@ class HiddenFileTest(unittest.TestCase):
with tempfile.NamedTemporaryFile() as f:
# Hide the file using
success = ctypes.windll.kernel32.SetFileAttributesW(
f.name, hidden_mask
self.assertTrue(
ctypes.windll.kernel32.SetFileAttributesW(f.name, hidden_mask),
"Could not set file attributes",
)
if not success:
self.skipTest("unable to set file attributes")
self.assertTrue(hidden.is_hidden(f.name))
def test_other_hidden(self):