mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
Moved tests related to ui into own folder. Moved 'modify' command tests into own file. Moved 'write' command tests into own file. Moved 'fields' command tests into own file. Moved 'do_query' test into own file. Moved 'list' command tests into own file. Moved 'remove' command tests into own file. Moved 'move' command tests into own file. Moved 'update' command tests into own file. Moved 'show_change' test into test_import file. Moved 'summarize_items' test into test_import file. Moved 'completion' command test into own file.
24 lines
685 B
Python
24 lines
685 B
Python
from beets import library
|
|
from beets.test.helper import IOMixin, ItemInDBTestCase
|
|
from beets.ui.commands.fields import fields_func
|
|
|
|
|
|
class FieldsTest(IOMixin, ItemInDBTestCase):
|
|
def remove_keys(self, keys, text):
|
|
for i in text:
|
|
try:
|
|
keys.remove(i)
|
|
except ValueError:
|
|
pass
|
|
|
|
def test_fields_func(self):
|
|
fields_func(self.lib, [], [])
|
|
items = library.Item.all_keys()
|
|
albums = library.Album.all_keys()
|
|
|
|
output = self.io.stdout.get().split()
|
|
self.remove_keys(items, output)
|
|
self.remove_keys(albums, output)
|
|
|
|
assert len(items) == 0
|
|
assert len(albums) == 0
|