mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 00:24:25 +01:00
Remove def suite TestLoader definitions
This commit is contained in:
parent
432da560e4
commit
fcff5d72af
71 changed files with 3 additions and 623 deletions
|
|
@ -99,11 +99,3 @@ class MapDataToSchemeTest(unittest.TestCase):
|
|||
("timbre", "bright"),
|
||||
}
|
||||
self.assertEqual(mapping, expected)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"""Test the advancedrewrite plugin for various configurations.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets.test.helper import BeetsTestCase
|
||||
from beets.ui import UserError
|
||||
|
|
@ -154,11 +153,3 @@ class AdvancedRewritePluginTest(BeetsTestCase):
|
|||
album="C",
|
||||
)
|
||||
self.assertEqual(item.artist, "D")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from beetsplug.albumtypes import AlbumTypesPlugin
|
|||
|
||||
class AlbumTypesPluginTest(PluginTestCase):
|
||||
"""Tests for albumtypes plugin."""
|
||||
|
||||
plugin = "albumtypes"
|
||||
|
||||
def test_renames_types(self):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import confuse
|
||||
|
|
@ -1016,11 +1015,3 @@ class EnforceRatioConfigTest(BeetsTestCase):
|
|||
def test_percent(self):
|
||||
self._load_with_config("0% 0.00% 5.1% 5% 100%".split(), False)
|
||||
self._load_with_config("00% 1.234% foo5% 100.1%".split(), True)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
"""Tests for the 'bareasc' plugin."""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets import logging
|
||||
from beets.test.helper import PluginTestCase, capture_stdout
|
||||
|
|
@ -11,6 +10,7 @@ from beets.test.helper import PluginTestCase, capture_stdout
|
|||
|
||||
class BareascPluginTest(PluginTestCase):
|
||||
"""Test bare ASCII query matching."""
|
||||
|
||||
plugin = "bareasc"
|
||||
|
||||
def setUp(self):
|
||||
|
|
@ -81,12 +81,3 @@ class BareascPluginTest(PluginTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual("Antonin Dvorak:: with accents\n", output.getvalue())
|
||||
|
||||
|
||||
def suite():
|
||||
"""loader."""
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"""Tests for the 'beatport' plugin.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
from datetime import timedelta
|
||||
|
||||
from beets.test import _common
|
||||
|
|
@ -656,11 +655,3 @@ class BeatportResponseEmptyTest(BeetsTestCase):
|
|||
self.assertEqual(
|
||||
tracks[0].genre, self.test_tracks[0]["subGenres"][0]["name"]
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
"""Tests for the 'bucket' plugin."""
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from beets import config, ui
|
||||
from beets.test.helper import BeetsTestCase
|
||||
from beetsplug import bucket
|
||||
|
|
@ -165,11 +163,3 @@ class BucketPluginTest(BeetsTestCase):
|
|||
self.check_span_from_str("1980 00", 1980, 2000)
|
||||
self.check_span_from_str("1930 00", 1930, 2000)
|
||||
self.check_span_from_str("1930 50", 1930, 1950)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -343,11 +343,3 @@ class NeverConvertLossyFilesTest(ConvertTestCase, ConvertCommand):
|
|||
self.run_convert_path(item.path)
|
||||
converted = os.path.join(self.convert_dest, b"converted.ogg")
|
||||
self.assertNoFileTag(converted, "mp3")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"""Tests for discogs plugin.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets import config
|
||||
from beets.test._common import Bag
|
||||
|
|
@ -424,11 +423,3 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
d = DiscogsPlugin().get_album_info(release)
|
||||
self.assertEqual(d.genre, "GENRE1, GENRE2")
|
||||
self.assertEqual(d.style, None)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
import codecs
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from beets.dbcore.query import TrueQuery
|
||||
|
|
@ -514,11 +513,3 @@ class EditDuringImporterTestCase(
|
|||
all("Edited Title " in i.title for i in self.lib.items())
|
||||
)
|
||||
self.assertTrue(all("match " in i.mb_trackid for i in self.lib.items()))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -339,11 +339,3 @@ class ArtSimilarityTest(unittest.TestCase):
|
|||
def test_convert_failure(self, mock_extract, mock_subprocess):
|
||||
self._mock_popens(mock_extract, mock_subprocess, convert_status=1)
|
||||
self.assertIsNone(self._similarity(20))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import unittest
|
||||
|
||||
import responses
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
|
@ -235,11 +233,3 @@ class EmbyUpdateTest(PluginTestCase):
|
|||
self.assertEqual(response[0]["Id"], "2ec276a2642e54a19b612b9418a8bd3b")
|
||||
|
||||
self.assertEqual(response[0]["Name"], "username")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
import json
|
||||
import re # used to test csv format
|
||||
import unittest
|
||||
from xml.etree import ElementTree
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
|
|
@ -85,11 +84,3 @@ class ExportPluginTest(PluginTestCase):
|
|||
txt = details.text
|
||||
self.assertIn(tag, self.test_values, msg=tag)
|
||||
self.assertEqual(self.test_values[tag], txt, msg=txt)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from beets import util
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
|
@ -99,11 +98,3 @@ class FetchartCliTest(PluginTestCase):
|
|||
self.run_command("fetchart")
|
||||
self.album.load()
|
||||
self.check_cover_is_stored()
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from mediafile import MediaFile
|
||||
|
||||
|
|
@ -217,11 +216,3 @@ class FileFilterPluginTest(ImportTestCase):
|
|||
],
|
||||
singletons=True,
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -169,11 +169,3 @@ class FtInTitlePluginTest(unittest.TestCase):
|
|||
self.assertTrue(ftintitle.contains_feat("Alice With Bob"))
|
||||
self.assertFalse(ftintitle.contains_feat("Alice defeat Bob"))
|
||||
self.assertFalse(ftintitle.contains_feat("Aliceft.Bob"))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -160,11 +160,3 @@ class HookTest(BeetsTestCase):
|
|||
for path in temporary_paths:
|
||||
self.assertTrue(os.path.isfile(path))
|
||||
os.remove(path)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -43,11 +43,3 @@ class IHatePluginTest(unittest.TestCase):
|
|||
"artist:testartist album:notthis",
|
||||
]
|
||||
self.assertTrue(IHatePlugin.do_i_hate_this(task, match_pattern))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
"""Tests for the `importadded` plugin."""
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from beets import importer
|
||||
from beets.test.helper import AutotagStub, ImportTestCase, PluginMixin
|
||||
|
|
@ -167,11 +166,3 @@ class ImportAddedTest(PluginMixin, ImportTestCase):
|
|||
"reimport modified Item.added for "
|
||||
+ displayable_path(item_path),
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import datetime
|
||||
import os
|
||||
import os.path
|
||||
import unittest
|
||||
|
||||
from beets import config
|
||||
from beets.library import Album, Item
|
||||
|
|
@ -67,11 +66,3 @@ class ImportfeedsTestTest(BeetsTestCase):
|
|||
self.assertTrue(os.path.isfile(playlist))
|
||||
with open(playlist) as playlist_contents:
|
||||
self.assertIn(item_path, playlist_contents.read())
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from mediafile import MediaFile
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
|
@ -118,11 +116,3 @@ class InfoTest(PluginTestCase):
|
|||
"$track. $title - $artist ($length)",
|
||||
)
|
||||
self.assertEqual("02. tïtle 0 - the artist (0:01)\n", out)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from beets.test import _common
|
||||
|
|
@ -79,11 +78,3 @@ class IPFSPluginTest(PluginTestCase):
|
|||
album.store(inherit=False)
|
||||
|
||||
return album
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from beets import util
|
||||
|
|
@ -77,11 +76,3 @@ class KeyFinderTest(PluginTestCase):
|
|||
|
||||
item.load()
|
||||
self.assertIsNone(item["initial_key"])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"""Tests for the 'lastgenre' plugin."""
|
||||
|
||||
|
||||
import unittest
|
||||
from unittest.mock import Mock
|
||||
|
||||
from beets import config
|
||||
|
|
@ -230,11 +229,3 @@ class LastGenrePluginTest(BeetsTestCase):
|
|||
tags = ("electronic", "ambient", "chillout")
|
||||
res = self.plugin._sort_by_depth(tags)
|
||||
self.assertEqual(res, ["ambient", "electronic"])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
"""Tests for the 'limit' plugin."""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
||||
|
|
@ -94,11 +93,3 @@ class LimitPluginTest(PluginTestCase):
|
|||
incorrect_order = self.num_limit_prefix + " " + self.track_tail_range
|
||||
result = self.lib.items(incorrect_order)
|
||||
self.assertEqual(len(result), 0)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -816,11 +816,3 @@ class SlugTests(unittest.TestCase):
|
|||
dashes = ["\u200D", "\u2010"]
|
||||
for dash1, dash2 in itertools.combinations(dashes, 2):
|
||||
self.assertEqual(lyrics.slug(dash1), lyrics.slug(dash2))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from beets.test.helper import (
|
||||
AutotagStub,
|
||||
ImportTestCase,
|
||||
|
|
@ -69,11 +67,3 @@ class MBSubmitPluginTest(PluginMixin, TerminalImportMixin, ImportTestCase):
|
|||
"Open files with Picard? " "02. Tag Title 2 - Tag Artist (0:01)"
|
||||
)
|
||||
self.assertIn(tracklist, output.getvalue())
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from beets import config
|
||||
|
|
@ -188,11 +187,3 @@ class MbsyncCliTest(PluginTestCase):
|
|||
self.run_command("mbsync", "-f", "'$title'")
|
||||
e = "mbsync: Skipping singleton with invalid mb_trackid: 'old title'"
|
||||
self.assertEqual(e, logs[0])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
from unittest.mock import ANY, Mock, call, patch
|
||||
|
||||
from beets import util
|
||||
|
|
@ -82,11 +81,3 @@ class MPDStatsTest(PluginTestCase):
|
|||
log.info.assert_has_calls(
|
||||
[call("pause"), call("playing {0}", ANY), call("stop")]
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -232,11 +232,3 @@ class ParentWorkTest(PluginTestCase):
|
|||
def test_direct_parent_work(self):
|
||||
self.assertEqual("2", parentwork.direct_parent_id("1")[0])
|
||||
self.assertEqual("3", parentwork.work_parent_id("1")[0])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import os
|
||||
import platform
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from beets.test._common import touch
|
||||
|
|
@ -103,11 +102,3 @@ class PermissionsPluginTest(PluginTestCase):
|
|||
self.assertEqual(
|
||||
expect_success, check_permissions(album.artpath, 0o777)
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -141,11 +141,3 @@ class PlayPluginTest(CleanupModulesMixin, PluginTestCase):
|
|||
|
||||
with self.assertRaises(UserError):
|
||||
self.run_command("play", "title:aNiceTitle")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1193,11 +1193,3 @@ class BPDPeersTest(BPDTestHelper):
|
|||
},
|
||||
expectedFailure=True,
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from shlex import quote
|
||||
|
||||
import beets
|
||||
|
|
@ -387,11 +386,3 @@ class PlaylistTestItemRemoved(PlaylistUpdateTest, PlaylistTestCase):
|
|||
"nonexisting.mp3",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import unittest
|
||||
|
||||
import responses
|
||||
|
||||
from beets.test.helper import PluginTestCase
|
||||
|
|
@ -132,11 +130,3 @@ class PlexUpdateTest(PluginTestCase):
|
|||
).status_code,
|
||||
200,
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
import mediafile
|
||||
|
||||
|
|
@ -124,11 +123,3 @@ class ExtendedFieldTestMixin(BeetsTestCase):
|
|||
with self.assertRaises(ValueError) as cm:
|
||||
mediafile.MediaFile.add_field("artist", mediafile.MediaField())
|
||||
self.assertIn('property "artist" already exists', str(cm.exception))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -77,11 +77,3 @@ class RandomTest(TestHelper, unittest.TestCase):
|
|||
self.assertAlmostEqual(0, median1, delta=1)
|
||||
self.assertAlmostEqual(len(self.items) // 2, median2, delta=1)
|
||||
self.assertGreater(stdev2, stdev1)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -392,12 +392,3 @@ class ReplayGainFfmpegThreadedImportTest(
|
|||
ThreadedImportMixin, ImportTest, ReplayGainTestCase, FfmpegBackendMixin
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
import unittest
|
||||
from os import fsdecode, path, remove
|
||||
from shutil import rmtree
|
||||
from tempfile import mkdtemp
|
||||
|
|
@ -373,11 +372,3 @@ class SmartPlaylistCLITest(PluginTestCase):
|
|||
for name in (b"my_playlist.m3u", b"all.m3u"):
|
||||
with open(path.join(self.temp_dir, name), "rb") as f:
|
||||
self.assertEqual(f.read(), self.item.path + b"\n")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"""Tests for the 'spotify' plugin"""
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
|
||||
import responses
|
||||
|
|
@ -177,11 +176,3 @@ class SpotifyPluginTest(BeetsTestCase):
|
|||
results = self.spotify._match_library_tracks(self.lib, "Happy")
|
||||
self.assertEqual(1, len(results))
|
||||
self.assertEqual("6NPVjNh8Jhru9xOmyQigds", results[0]["id"])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"""Tests for the 'subsonic' plugin."""
|
||||
|
||||
import unittest
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
|
||||
import responses
|
||||
|
|
@ -183,12 +182,3 @@ class SubsonicPluginTest(BeetsTestCase):
|
|||
)
|
||||
|
||||
self.subsonicupdate.start_scan()
|
||||
|
||||
|
||||
def suite():
|
||||
"""Default test suite."""
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
"""Tests for the 'the' plugin"""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets import config
|
||||
from beets.test.helper import BeetsTestCase
|
||||
from beetsplug.the import FORMAT, PATTERN_A, PATTERN_THE, ThePlugin
|
||||
|
|
@ -61,11 +59,3 @@ class ThePluginTest(BeetsTestCase):
|
|||
config["the"]["patterns"] = [PATTERN_THE, PATTERN_A]
|
||||
config["the"]["format"] = "{1} ({0})"
|
||||
self.assertEqual(ThePlugin().the_template_func("The A"), "The (A)")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
|
||||
import os.path
|
||||
import unittest
|
||||
from shutil import rmtree
|
||||
from tempfile import mkdtemp
|
||||
from unittest.mock import Mock, call, patch
|
||||
|
|
@ -281,11 +280,3 @@ class TestPathlibURI:
|
|||
|
||||
# test it won't break if we pass it bytes for a path
|
||||
test_uri.uri(b"/")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
|
||||
import time
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
|
||||
from confuse import ConfigValueError
|
||||
|
|
@ -193,11 +192,3 @@ class TypesPluginTest(PluginTestCase):
|
|||
|
||||
def mktime(*args):
|
||||
return time.mktime(datetime(*args).timetuple())
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import json
|
|||
import os.path
|
||||
import platform
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from beets import logging
|
||||
from beets.library import Album, Item
|
||||
|
|
@ -677,11 +676,3 @@ class WebPluginTest(ItemInDBTestCase):
|
|||
response = self.client.get("/item/" + str(item_id) + "/file")
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
"""Tests for the 'zero' plugin"""
|
||||
|
||||
import unittest
|
||||
|
||||
from mediafile import MediaFile
|
||||
|
||||
from beets.library import Item
|
||||
|
|
@ -292,11 +290,3 @@ class ZeroPluginTest(BeetsTestCase):
|
|||
self.assertEqual(mf.year, 2016)
|
||||
self.assertEqual(mf.comments, "test comment")
|
||||
self.assertEqual(item["comments"], "test comment")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -154,12 +154,3 @@ class ArtResizerFileSizeTest(CleanupModulesMixin, BeetsTestCase):
|
|||
except AssertionError:
|
||||
command = im.convert_cmd + "foo -set b B -set a A foo".split()
|
||||
mock_util.command_output.assert_called_once_with(command)
|
||||
|
||||
|
||||
def suite():
|
||||
"""Run this suite of tests."""
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1088,11 +1088,3 @@ class EnumTest(BeetsTestCase):
|
|||
self.assertGreater(OrderedEnumClass.b, OrderedEnumClass.a)
|
||||
self.assertGreater(OrderedEnumClass.c, OrderedEnumClass.a)
|
||||
self.assertGreater(OrderedEnumClass.c, OrderedEnumClass.b)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import yaml
|
||||
|
|
@ -128,11 +127,3 @@ class ConfigCommandTest(BeetsTestCase):
|
|||
with patch("os.execlp") as execlp:
|
||||
self.run_command("config", "-e")
|
||||
execlp.assert_called_once_with("myeditor", "myeditor", self.config_path)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -318,11 +318,3 @@ class DateQueryConstructTest(unittest.TestCase):
|
|||
def test_datetime_invalid_separator(self):
|
||||
with self.assertRaises(InvalidQueryArgumentValueError):
|
||||
DateQuery("added", "2000-01-01x12")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -762,11 +762,3 @@ class ResultsIteratorTest(unittest.TestCase):
|
|||
self.assertIsNone(
|
||||
self.db._fetch(ModelFixture1, dbcore.query.FalseQuery()).get()
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -692,11 +692,3 @@ class MkDirAllTest(BeetsTestCase):
|
|||
path = os.path.join(self.temp_dir, b"foo", b"bar", b"baz", b"qux.mp3")
|
||||
util.mkdirall(path)
|
||||
self.assertNotExists(path)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -74,11 +74,3 @@ class HiddenFileTest(unittest.TestCase):
|
|||
with tempfile.NamedTemporaryFile(prefix=".tmp") as f:
|
||||
fn = util.bytestring_path(f.name)
|
||||
self.assertTrue(hidden.is_hidden(fn))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -2008,11 +2008,3 @@ class ImportMusicBrainzIdTest(ImportTestCase):
|
|||
{"VALID_RECORDING_0", "VALID_RECORDING_1"},
|
||||
{c.info.title for c in task.candidates},
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1392,11 +1392,3 @@ class LibraryFieldTypesTest(unittest.TestCase):
|
|||
beets.config["format_raw_length"] = True
|
||||
self.assertEqual(61.23, t.format(61.23))
|
||||
self.assertEqual(3601.23, t.format(3601.23))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
import logging as log
|
||||
import sys
|
||||
import threading
|
||||
import unittest
|
||||
from io import StringIO
|
||||
|
||||
import beets.logging as blog
|
||||
|
|
@ -49,6 +48,7 @@ class LoggingTest(BeetsTestCase):
|
|||
|
||||
class LoggingLevelTest(PluginTestCase):
|
||||
plugin = "dummy"
|
||||
|
||||
class DummyModule:
|
||||
class DummyPlugin(plugins.BeetsPlugin):
|
||||
def __init__(self):
|
||||
|
|
@ -281,11 +281,3 @@ class ConcurrentEventsTest(BeetsTestCase):
|
|||
importer = self.create_importer()
|
||||
importer.run()
|
||||
self.assertIn("Sending event: database_change", logs)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -148,12 +148,3 @@ class M3UFileTest(unittest.TestCase):
|
|||
m3ufile = M3UFile(the_playlist_file)
|
||||
m3ufile.load()
|
||||
self.assertFalse(m3ufile.extm3u)
|
||||
|
||||
|
||||
def suite():
|
||||
"""This testsuite's main function."""
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1077,11 +1077,3 @@ class MBLibraryTest(unittest.TestCase):
|
|||
gp.side_effect = side_effect
|
||||
album = mb.album_for_id("d2a6f856-b553-40a0-ac54-a321e8e2da02")
|
||||
self.assertIsNone(album.country)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
import os
|
||||
import platform
|
||||
import time
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
|
||||
from beets.library import Item
|
||||
|
|
@ -128,11 +127,3 @@ class MetaSyncTest(PluginTestCase):
|
|||
_parsetime("2014-04-24 09:28:38"),
|
||||
)
|
||||
self.assertFalse(hasattr(self.lib.items()[1], "itunes_lastskipped"))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -230,11 +230,3 @@ class StageDecoratorTest(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
list(pl.pull()), [{"x": True}, {"a": False, "x": True}]
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -632,11 +632,3 @@ class ParseBeatportIDTest(unittest.TestCase):
|
|||
id_url = "https://www.beatport.com/release/album-name/%s" % id_string
|
||||
out = MetadataSourcePlugin._get_id("album", id_url, beatport_id_regex)
|
||||
self.assertEqual(out, id_string)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1161,11 +1161,3 @@ class RelatedQueriesTest(BeetsTestCase, AssertsMixin):
|
|||
q = "catalognum:ABC Album1"
|
||||
results = self.lib.albums(q)
|
||||
self.assert_albums_matched(results, ["Album1"])
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
"""Various tests for querying the library database.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
import beets.library
|
||||
from beets import config, dbcore
|
||||
|
|
@ -531,11 +530,3 @@ class NonExistingFieldTest(DummyDataTestCase):
|
|||
self.assertTrue(isinstance(query.subqueries[0], dbcore.query.TrueQuery))
|
||||
self.assertTrue(isinstance(sort, dbcore.query.SlowFieldSort))
|
||||
self.assertEqual(sort.field, "-bar")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -290,11 +290,3 @@ class EvalTest(unittest.TestCase):
|
|||
|
||||
def test_function_call_with_empty_arg(self):
|
||||
self.assertEqual(self._eval("%len{}"), "0")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -1648,11 +1648,3 @@ class EncodingTest(BeetsTestCase):
|
|||
with patch("sys.stdin") as stdin:
|
||||
stdin.encoding = None
|
||||
self.assertEqual(ui._in_encoding(), "utf-8")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from beets import library, ui
|
||||
from beets.test import _common
|
||||
|
|
@ -104,11 +103,3 @@ class FieldsTest(ItemInDBTestCase):
|
|||
|
||||
self.assertEqual(len(items), 0)
|
||||
self.assertEqual(len(albums), 0)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ test_importer module. But here the test importer inherits from
|
|||
``TerminalImportSession``. So we test this class, too.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
from test import test_importer
|
||||
|
||||
from beets.test.helper import TerminalImportMixin
|
||||
|
|
@ -70,11 +69,3 @@ class GlobalGroupAlbumsImportTest(
|
|||
TerminalImportMixin, test_importer.GlobalGroupAlbumsImportTest
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
from copy import deepcopy
|
||||
from random import random
|
||||
|
||||
|
|
@ -160,11 +159,3 @@ class ParentalDirCreation(BeetsTestCase):
|
|||
if lib:
|
||||
lib._close()
|
||||
raise OSError("Parent directories should not be created.")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -216,11 +216,3 @@ class PathTruncationTest(BeetsTestCase):
|
|||
with _common.platform_posix():
|
||||
p = util.truncate_path("abcde/fgh.ext", 5)
|
||||
self.assertEqual(p, "abcde/f.ext")
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Tests for the virtual filesystem builder.."""
|
||||
|
||||
import unittest
|
||||
|
||||
from beets import vfs
|
||||
from beets.test import _common
|
||||
|
|
@ -41,11 +40,3 @@ class VFSTest(BeetsTestCase):
|
|||
self.assertEqual(
|
||||
self.tree.dirs["albums"].dirs["the album"].files["the title"], 2
|
||||
)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
|
|
@ -16,25 +16,7 @@
|
|||
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
pkgpath = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) or ".."
|
||||
sys.path.insert(0, pkgpath)
|
||||
|
||||
|
||||
def suite():
|
||||
s = unittest.TestSuite()
|
||||
# Get the suite() of every module in this directory beginning with
|
||||
# "test_".
|
||||
for fname in os.listdir(os.path.join(pkgpath, "test")):
|
||||
match = re.match(r"(test_\S+)\.py$", fname)
|
||||
if match:
|
||||
modname = match.group(1)
|
||||
s.addTest(__import__(modname).suite())
|
||||
return s
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(defaultTest="suite")
|
||||
|
|
|
|||
Loading…
Reference in a new issue