Skip to content

Commit

Permalink
windows: do not skip test when hiding file fails
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Jul 18, 2024
1 parent 370ae43 commit c9702a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 5 additions & 4 deletions test/plugins/test_fetchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ def check_cover_is_stored(self):

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")
Expand Down
9 changes: 3 additions & 6 deletions test/test_hidden.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ def test_windows_hidden(self):

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):
Expand Down

0 comments on commit c9702a4

Please sign in to comment.