Debian Codegraph @

test/plugins/test_mbsubmit.py

raw
1 from beets.test.helper import (
2 AutotagImportTestCase,
3 PluginMixin,
4 TerminalImportMixin,
5 )
6
7
8 class MBSubmitPluginTest(
9 PluginMixin, TerminalImportMixin, AutotagImportTestCase
10 ):
11 plugin = "mbsubmit"
12
13 def setUp(self):
14 super().setUp()
15 self.prepare_album_for_import(2)
16 self.setup_importer()
17
18 def test_print_tracks_output(self):
19 """Test the output of the "print tracks" choice."""
20 self.io.addinput("p")
21 self.io.addinput("s")
22 # Print tracks; Skip
23 self.importer.run()
24
25 # Manually build the string for comparing the output.
26 tracklist = (
27 "Open files with Picard? "
28 "01. Tag Track 1 - Tag Artist (0:01)\n"
29 "02. Tag Track 2 - Tag Artist (0:01)"
30 )
31 assert tracklist in self.io.getoutput()
32
33 def test_print_tracks_output_as_tracks(self):
34 """Test the output of the "print tracks" choice, as singletons."""
35 self.io.addinput("t")
36 self.io.addinput("s")
37 self.io.addinput("p")
38 self.io.addinput("s")
39 # as Tracks; Skip; Print tracks; Skip
40 self.importer.run()
41
42 # Manually build the string for comparing the output.
43 tracklist = (
44 "Open files with Picard? 02. Tag Track 2 - Tag Artist (0:01)"
45 )
46 assert tracklist in self.io.getoutput()