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

Method test_write_with_custom_path

test/test_library.py:1297–1308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1295 os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
1296
1297 def test_write_with_custom_path(self):
1298 item = self.add_item_fixture()
1299 custom_path = os.path.join(self.temp_dir, b"custom.mp3")
1300 shutil.copy(syspath(item.path), syspath(custom_path))
1301
1302 item["artist"] = "new artist"
1303 assert MediaFile(syspath(custom_path)).artist != "new artist"
1304 assert MediaFile(syspath(item.path)).artist != "new artist"
1305
1306 item.write(custom_path)
1307 assert MediaFile(syspath(custom_path)).artist == "new artist"
1308 assert MediaFile(syspath(item.path)).artist != "new artist"
1309
1310 def test_write_custom_tags(self):
1311 item = self.add_item_fixture(artist="old artist")

Callers

nothing calls this directly

Calls 5

syspathFunction · 0.90
joinMethod · 0.80
add_item_fixtureMethod · 0.45
copyMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected