mirror of
https://github.com/beetbox/beets.git
synced 2026-02-17 12:56:05 +01:00
Skip symlink tests on Windows
... where there is no symlinking.
This commit is contained in:
parent
0e3f6cb09d
commit
ba87ea1f30
3 changed files with 7 additions and 0 deletions
|
|
@ -53,6 +53,9 @@ log.setLevel(logging.DEBUG)
|
|||
# Dummy item creation.
|
||||
_item_ident = 0
|
||||
|
||||
# OS feature test.
|
||||
HAVE_SYMLINK = hasattr(os, 'symlink')
|
||||
|
||||
|
||||
def item(lib=None):
|
||||
global _item_ident
|
||||
|
|
|
|||
|
|
@ -124,16 +124,19 @@ class MoveTest(_common.TestCase):
|
|||
self.assertEqual(os.path.dirname(self.i.path),
|
||||
os.path.dirname(dest))
|
||||
|
||||
@unittest.skipUnless(_common.HAVE_SYMLINK, "need symlinks")
|
||||
def test_link_arrives(self):
|
||||
self.i.move(link=True)
|
||||
self.assertExists(self.dest)
|
||||
self.assertTrue(os.path.islink(self.dest))
|
||||
self.assertEqual(os.readlink(self.dest), self.path)
|
||||
|
||||
@unittest.skipUnless(_common.HAVE_SYMLINK, "need symlinks")
|
||||
def test_link_does_not_depart(self):
|
||||
self.i.move(link=True)
|
||||
self.assertExists(self.path)
|
||||
|
||||
@unittest.skipUnless(_common.HAVE_SYMLINK, "need symlinks")
|
||||
def test_link_changes_path(self):
|
||||
self.i.move(link=True)
|
||||
self.assertEqual(self.i.path, util.normpath(self.dest))
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ class NonAutotaggedImportTest(_common.TestCase, ImportHelper):
|
|||
self.importer.run()
|
||||
self.assertNotExists(os.path.join(self.import_dir, 'the_album'))
|
||||
|
||||
@unittest.skipUnless(_common.HAVE_SYMLINK, "need symlinks")
|
||||
def test_import_link_arrives(self):
|
||||
config['import']['link'] = True
|
||||
self.importer.run()
|
||||
|
|
|
|||
Loading…
Reference in a new issue