diff --git a/test/_common.py b/test/_common.py index 05adb23df..350b4e948 100644 --- a/test/_common.py +++ b/test/_common.py @@ -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 diff --git a/test/test_files.py b/test/test_files.py index 126f0821e..27aa93cd8 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -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)) diff --git a/test/test_importer.py b/test/test_importer.py index 81bd4f9ef..7b07ea331 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -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()