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

Method setUp

test/test_files.py:319–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

317
318class ArtFileTest(BeetsTestCase):
319 def setUp(self):
320 super().setUp()
321
322 # Make library and item.
323 self.i = item(self.lib)
324 self.i.path = self.i.destination()
325 # Make a music file.
326 util.mkdirall(self.i.path)
327 touch(self.i.path)
328 # Make an album.
329 self.ai = self.lib.add_album((self.i,))
330 # Make an art file too.
331 art_bytes = self.lib.get_album(self.i).art_destination("something.jpg")
332 self.art = Path(os.fsdecode(art_bytes))
333 self.art.touch()
334 self.ai.artpath = art_bytes
335 self.ai.store()
336 # Alternate destination dir.
337 self.otherdir = os.path.join(self.temp_dir, b"testotherdir")
338
339 def test_art_deleted_when_items_deleted(self):
340 assert self.art.exists()

Callers

nothing calls this directly

Calls 10

itemFunction · 0.90
touchFunction · 0.90
destinationMethod · 0.80
art_destinationMethod · 0.80
touchMethod · 0.80
joinMethod · 0.80
setUpMethod · 0.45
add_albumMethod · 0.45
get_albumMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected