Skip implicit paths tests for win32

This commit is contained in:
Šarūnas Nejus 2022-05-31 22:34:40 +01:00
parent d68ed1adca
commit ba777dda50
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435

View file

@ -33,6 +33,9 @@ from beets.library import Library, Item
from beets import util
import platform
# Because the absolute path begins with something like C:, we
# can't disambiguate it from an ordinary query.
WIN32_NO_IMPLICIT_PATHS = 'Implicit paths are not supported on Windows'
class TestHelper(helper.TestHelper):
@ -521,6 +524,7 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin):
results = self.lib.albums(q)
self.assert_albums_matched(results, ['path album'])
@unittest.skipIf(sys.platform == 'win32', WIN32_NO_IMPLICIT_PATHS)
def test_slashed_query_matches_path(self):
q = '/a/b'
results = self.lib.items(q)
@ -529,6 +533,7 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin):
results = self.lib.albums(q)
self.assert_albums_matched(results, ['path album'])
@unittest.skipIf(sys.platform == 'win32', WIN32_NO_IMPLICIT_PATHS)
def test_path_query_in_or_query(self):
q = '/a/b , /a/b'
results = self.lib.items(q)
@ -648,12 +653,8 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin):
self.assertFalse(is_path('foo:bar/'))
self.assertFalse(is_path('foo:/bar'))
@unittest.skipIf(sys.platform == 'win32', WIN32_NO_IMPLICIT_PATHS)
def test_detect_absolute_path(self):
if platform.system() == 'Windows':
# Because the absolute path begins with something like C:, we
# can't disambiguate it from an ordinary query.
self.skipTest('Windows absolute paths do not work as queries')
# Don't patch `os.path.exists`; we'll actually create a file when
# it exists.
self.patcher_exists.stop()