mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
confit: replace with confuse in tests
This commit is contained in:
parent
6382c364e2
commit
d2f13bf65c
6 changed files with 12 additions and 10 deletions
|
|
@ -175,8 +175,7 @@ class TestCase(unittest.TestCase, Assertions):
|
|||
beets.config['directory'] = \
|
||||
util.py3_path(os.path.join(self.temp_dir, b'libdir'))
|
||||
|
||||
# Set $HOME, which is used by confit's `config_dir()` to create
|
||||
# directories.
|
||||
# Set $HOME, which is used by Confuse to create directories.
|
||||
self._old_home = os.environ.get('HOME')
|
||||
os.environ['HOME'] = util.py3_path(self.temp_dir)
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from beets import importer
|
|||
from beets import logging
|
||||
from beets import util
|
||||
from beets.util.artresizer import ArtResizer, WEBPROXY
|
||||
from beets.util import confit
|
||||
import confuse
|
||||
|
||||
|
||||
logger = logging.getLogger('beets.test_art')
|
||||
|
|
@ -753,7 +753,7 @@ class EnforceRatioConfigTest(_common.TestCase):
|
|||
if should_raise:
|
||||
for v in values:
|
||||
config['fetchart']['enforce_ratio'] = v
|
||||
with self.assertRaises(confit.ConfigValueError):
|
||||
with self.assertRaises(confuse.ConfigValueError):
|
||||
fetchart.FetchArtPlugin()
|
||||
else:
|
||||
for v in values:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ from test import _common
|
|||
|
||||
from beets import logging
|
||||
from beets.library import Item
|
||||
from beets.util import bytestring_path, confit
|
||||
from beets.util import bytestring_path
|
||||
import confuse
|
||||
|
||||
from beetsplug import lyrics
|
||||
|
||||
|
|
@ -222,7 +223,8 @@ def is_lyrics_content_ok(title, text):
|
|||
return keywords <= words
|
||||
|
||||
LYRICS_ROOT_DIR = os.path.join(_common.RSRC, b'lyrics')
|
||||
LYRICS_TEXTS = confit.load_yaml(os.path.join(_common.RSRC, b'lyricstext.yaml'))
|
||||
yaml_path = os.path.join(_common.RSRC, b'lyricstext.yaml')
|
||||
LYRICS_TEXTS = confuse.load_yaml(yaml_path)
|
||||
|
||||
|
||||
class LyricsGoogleBaseTest(unittest.TestCase):
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ import tempfile
|
|||
from contextlib import contextmanager
|
||||
import random
|
||||
|
||||
from beets.util import confit, py3_path
|
||||
from beets.util import py3_path
|
||||
from beetsplug import bpd
|
||||
import confuse
|
||||
|
||||
|
||||
# Mock GstPlayer so that the forked process doesn't attempt to import gi:
|
||||
|
|
@ -285,7 +286,7 @@ class BPDTestHelper(unittest.TestCase, TestHelper):
|
|||
mode='wb', dir=py3_path(self.temp_dir), suffix='.yaml',
|
||||
delete=False)
|
||||
config_file.write(
|
||||
yaml.dump(config, Dumper=confit.Dumper, encoding='utf-8'))
|
||||
yaml.dump(config, Dumper=confuse.Dumper, encoding='utf-8'))
|
||||
config_file.close()
|
||||
|
||||
# Fork and launch BPD in the new process:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import unittest
|
|||
|
||||
from test.helper import TestHelper
|
||||
|
||||
from beets.util.confit import ConfigValueError
|
||||
from confuse import ConfigValueError
|
||||
|
||||
|
||||
class TypesPluginTest(unittest.TestCase, TestHelper):
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ from beets.autotag.match import distance
|
|||
from mediafile import MediaFile
|
||||
from beets import config
|
||||
from beets import plugins
|
||||
from beets.util.confit import ConfigError
|
||||
from confuse import ConfigError
|
||||
from beets import util
|
||||
from beets.util import syspath, MoveOperation
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue