mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 03:54:21 +01:00
Remove pathlib dependency
This commit is contained in:
parent
651bdf0acc
commit
6eb497b21b
4 changed files with 6 additions and 10 deletions
1
setup.py
1
setup.py
|
|
@ -82,7 +82,6 @@ setup(name='beets',
|
|||
|
||||
tests_require=[
|
||||
'responses',
|
||||
'pathlib',
|
||||
],
|
||||
|
||||
# Plugin (optional) dependencies:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import os
|
|||
import os.path
|
||||
import shutil
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from glob import glob
|
||||
from contextlib import contextmanager
|
||||
from StringIO import StringIO
|
||||
|
|
@ -144,7 +143,7 @@ class TestHelper(object):
|
|||
|
||||
def add_item_fixtures(self, ext='mp3', count=1):
|
||||
items = []
|
||||
paths = list(Path(_common.RSRC).glob('*.' + ext))
|
||||
paths = glob(os.path.join(_common.RSRC, '*.' + ext))
|
||||
for path in paths[0:count]:
|
||||
item = Item.from_path(str(path))
|
||||
item.add(self.lib)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
import os.path
|
||||
from pathlib import Path
|
||||
from _common import unittest
|
||||
from helper import TestHelper, controlStdin
|
||||
|
||||
|
|
@ -49,7 +48,7 @@ class ImportCliTest(unittest.TestCase, TestHelper):
|
|||
self.item, = self.add_item_fixtures(ext='ogg')
|
||||
self.load_plugins('convert')
|
||||
|
||||
self.convert_dest = Path(self.temp_dir) / 'convert_dest'
|
||||
self.convert_dest = os.path.join(self.temp_dir, 'convert_dest')
|
||||
self.config['convert']['dest'] = str(self.convert_dest)
|
||||
self.config['convert']['command'] = u'cp $source $dest'
|
||||
self.config['convert']['paths']['default'] = u'converted'
|
||||
|
|
@ -61,17 +60,17 @@ class ImportCliTest(unittest.TestCase, TestHelper):
|
|||
def test_convert(self):
|
||||
with controlStdin('y'):
|
||||
self.run_command('convert', self.item.path)
|
||||
converted = Path(self.convert_dest) / 'converted.mp3'
|
||||
self.assertTrue(converted.is_file())
|
||||
converted = os.path.join(self.convert_dest, 'converted.mp3')
|
||||
self.assertTrue(os.path.isfile(converted))
|
||||
|
||||
def test_convert_keep_new(self):
|
||||
self.assertEqual(Path(self.item.path).suffix, '.ogg')
|
||||
self.assertEqual(os.path.splitext(self.item.path)[1], '.ogg')
|
||||
|
||||
with controlStdin('y'):
|
||||
self.run_command('convert', '--keep-new', self.item.path)
|
||||
|
||||
self.item.load()
|
||||
self.assertEqual(Path(self.item.path).suffix, '.mp3')
|
||||
self.assertEqual(os.path.splitext(self.item.path)[1], '.mp3')
|
||||
|
||||
|
||||
def suite():
|
||||
|
|
|
|||
1
tox.ini
1
tox.ini
|
|
@ -12,7 +12,6 @@ deps =
|
|||
pylast
|
||||
flask
|
||||
responses
|
||||
pathlib
|
||||
commands =
|
||||
nosetests {posargs}
|
||||
sitepackages = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue