mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
windows: do not skip test when hiding file fails
This commit is contained in:
parent
370ae43634
commit
c9702a4c24
2 changed files with 8 additions and 10 deletions
|
|
@ -42,11 +42,12 @@ class FetchartCliTest(unittest.TestCase, TestHelper):
|
||||||
|
|
||||||
def hide_file_windows(self):
|
def hide_file_windows(self):
|
||||||
hidden_mask = 2
|
hidden_mask = 2
|
||||||
success = ctypes.windll.kernel32.SetFileAttributesW(
|
self.assertTrue(
|
||||||
|
ctypes.windll.kernel32.SetFileAttributesW(
|
||||||
self.cover_path, hidden_mask
|
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):
|
def test_set_art_from_folder(self):
|
||||||
self.touch(b"c\xc3\xb6ver.jpg", dir=self.album.path, content="IMAGE")
|
self.touch(b"c\xc3\xb6ver.jpg", dir=self.album.path, content="IMAGE")
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,10 @@ class HiddenFileTest(unittest.TestCase):
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile() as f:
|
with tempfile.NamedTemporaryFile() as f:
|
||||||
# Hide the file using
|
# Hide the file using
|
||||||
success = ctypes.windll.kernel32.SetFileAttributesW(
|
self.assertTrue(
|
||||||
f.name, hidden_mask
|
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))
|
self.assertTrue(hidden.is_hidden(f.name))
|
||||||
|
|
||||||
def test_other_hidden(self):
|
def test_other_hidden(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue