From 9ec2f3f5121df4098ebdfc8b7ab9845d4741ed10 Mon Sep 17 00:00:00 2001 From: jossmoff Date: Sun, 22 Oct 2023 19:50:05 +0100 Subject: [PATCH] rc3 --- bookshelf/__init__.py | 2 +- bookshelf/storage.py | 2 +- test/test_storage.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bookshelf/__init__.py b/bookshelf/__init__.py index 3b93d0b..27fdca4 100644 --- a/bookshelf/__init__.py +++ b/bookshelf/__init__.py @@ -1 +1 @@ -__version__ = "0.0.2" +__version__ = "0.0.3" diff --git a/bookshelf/storage.py b/bookshelf/storage.py index ff861cf..be798d4 100644 --- a/bookshelf/storage.py +++ b/bookshelf/storage.py @@ -16,7 +16,7 @@ def __init__(self): pass def save_story(self, story: Story) -> None: - if self.story_exists(story.name): + if not self.story_exists(story.name): os.makedirs(self.BOOKSHELF_TASK_DIR) filename = os.path.join(self.BOOKSHELF_TASK_DIR, f'{story.name}.json') with open(filename, 'w') as file: diff --git a/test/test_storage.py b/test/test_storage.py index 380c2e1..d4ee95f 100644 --- a/test/test_storage.py +++ b/test/test_storage.py @@ -87,7 +87,7 @@ def test_load_nonexistent_story(bookshelf_storage, mock_home): def test_save_non_existing_story(bookshelf_storage, mock_home): - os.path.exists = MagicMock(return_value=True) + os.path.exists = MagicMock(return_value=False) os.makedirs = MagicMock() json.dump = MagicMock()