mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 04:55:10 +01:00
Add test case for single file import
This commit is contained in:
parent
c9141a6adf
commit
2011156f8b
1 changed files with 21 additions and 0 deletions
|
|
@ -327,6 +327,7 @@ class ImportSingletonTest(_common.TestCase, ImportHelper):
|
|||
"""Test ``APPLY`` and ``ASIS`` choices for an import session with singletons
|
||||
config set to True.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(ImportSingletonTest, self).setUp()
|
||||
self._setup_library()
|
||||
|
|
@ -391,6 +392,26 @@ class ImportSingletonTest(_common.TestCase, ImportHelper):
|
|||
self.importer.run()
|
||||
self.assertEqual(len(self.lib.items()), 1)
|
||||
|
||||
def test_import_single_files(self):
|
||||
resource_path = os.path.join(_common.RSRC, u'empty.mp3')
|
||||
single_path = os.path.join(self.import_dir, u'track_2.mp3')
|
||||
|
||||
shutil.copy(resource_path, single_path)
|
||||
import_files = [
|
||||
os.path.join(self.import_dir, u'the_album'),
|
||||
single_path
|
||||
]
|
||||
self._setup_import_session(singletons = False)
|
||||
self.importer.paths = import_files
|
||||
|
||||
self.importer.add_choice(importer.action.ASIS)
|
||||
self.importer.add_choice(importer.action.ASIS)
|
||||
self.importer.run()
|
||||
|
||||
self.assertEqual(len(self.lib.items()), 2)
|
||||
self.assertEqual(len(self.lib.albums()), 2)
|
||||
|
||||
|
||||
class ImportTest(_common.TestCase, ImportHelper):
|
||||
"""Test APPLY, ASIS and SKIP choices.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue