Fix rename and add test
This commit is contained in:
parent
94be266e17
commit
f2a68d6c8b
@ -750,7 +750,7 @@ class ComicArchive:
|
||||
if new_path == self.path:
|
||||
return
|
||||
os.makedirs(new_path.parent, 0o777, True)
|
||||
shutil.move(path, new_path)
|
||||
shutil.move(self.path, new_path)
|
||||
self.path = new_path
|
||||
self.archiver.path = pathlib.Path(path)
|
||||
|
||||
|
@ -88,3 +88,11 @@ def test_copy_from_archive(archiver, tmp_path, cbz):
|
||||
|
||||
md = comic_archive.read_cix()
|
||||
assert md == comicapi.genericmetadata.md_test
|
||||
|
||||
|
||||
def test_rename(tmp_comic, tmp_path):
|
||||
old_path = tmp_comic.path
|
||||
tmp_comic.rename(tmp_path / "test.cbz")
|
||||
assert not old_path.exists()
|
||||
assert tmp_comic.path.exists()
|
||||
assert tmp_comic.path != old_path
|
||||
|
Loading…
Reference in New Issue
Block a user