Use shutil.move() instead of os.replace/rename

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2020-01-28 21:50:27 +00:00
parent 7f438d1b75
commit b39345e1f0
3 changed files with 6 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
import os
import shutil
import unittest
from tempfile import NamedTemporaryFile
@@ -80,7 +81,7 @@ class CoverArtTestCase(unittest.TestCase):
with NamedTemporaryFile(suffix='.cover.jpg', delete=False) as f:
f.write(data)
os.chmod(f.name, 0o644)
os.replace(f.name, cover_art_path)
shutil.move(f.name, cover_art_path)
return cover_art_path
def testCoverArtPath(self):