diff --git a/comicapi/comicarchive.py b/comicapi/comicarchive.py index 721b0e3..ed7516c 100644 --- a/comicapi/comicarchive.py +++ b/comicapi/comicarchive.py @@ -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) diff --git a/tests/comicarchive_test.py b/tests/comicarchive_test.py index a57f655..27b3cb2 100644 --- a/tests/comicarchive_test.py +++ b/tests/comicarchive_test.py @@ -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