MCPcopy
hub / github.com/beetbox/beets / MetaSyncTest

Class MetaSyncTest

test/test_metasync.py:34–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class MetaSyncTest(IOMixin, PluginTestCase):
35 plugin = "metasync"
36 itunes_library_unix = os.path.join(_common.RSRC, b"itunes_library_unix.xml")
37 itunes_library_windows = os.path.join(
38 _common.RSRC, b"itunes_library_windows.xml"
39 )
40
41 def setUp(self):
42 super().setUp()
43
44 self.config["metasync"]["source"] = "itunes"
45
46 if _is_windows():
47 self.config["metasync"]["itunes"]["library"] = os.fsdecode(
48 self.itunes_library_windows
49 )
50 else:
51 self.config["metasync"]["itunes"]["library"] = os.fsdecode(
52 self.itunes_library_unix
53 )
54
55 self._set_up_data()
56
57 def _set_up_data(self):
58 items = [_common.item() for _ in range(2)]
59
60 items[0].title = "Tessellate"
61 items[0].artist = "alt-J"
62 items[0].albumartist = "alt-J"
63 items[0].album = "An Awesome Wave"
64 items[0].itunes_rating = 60
65
66 items[1].title = "Breezeblocks"
67 items[1].artist = "alt-J"
68 items[1].albumartist = "alt-J"
69 items[1].album = "An Awesome Wave"
70
71 if _is_windows():
72 items[
73 0
74 ].path = "G:\\Music\\Alt-J\\An Awesome Wave\\03 Tessellate.mp3"
75 items[
76 1
77 ].path = "G:\\Music\\Alt-J\\An Awesome Wave\\04 Breezeblocks.mp3"
78 else:
79 items[0].path = "/Music/Alt-J/An Awesome Wave/03 Tessellate.mp3"
80 items[1].path = "/Music/Alt-J/An Awesome Wave/04 Breezeblocks.mp3"
81
82 for item in items:
83 self.lib.add(item)
84
85 def test_load_item_types(self):
86 # This test also verifies that the MetaSources have loaded correctly
87 assert "amarok_score" in Item._types
88 assert "itunes_rating" in Item._types
89
90 def test_pretend_sync_from_itunes(self):
91 out = self.run_with_output("metasync", "-p")

Callers

nothing calls this directly

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected