Skip to content

Commit

Permalink
tests: Add test for rename/delete budget exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanelli committed Jul 7, 2024
1 parent ff0c50c commit 013aded
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from actual import Actual
from actual.exceptions import ActualError
from actual.exceptions import ActualError, UnknownFileId
from actual.protobuf_models import Message


Expand All @@ -16,3 +16,12 @@ def test_api_apply(mocker):
m.dataset = "accounts"
with pytest.raises(ActualError, match="column 'bar' at table 'accounts' not found"):
actual.apply_changes([m])


def test_rename_delete_budget_without_file():
actual = Actual.__new__(Actual)
actual._file = None
with pytest.raises(UnknownFileId, match="No current file loaded"):
actual.delete_budget()
with pytest.raises(UnknownFileId, match="No current file loaded"):
actual.rename_budget("foo")

0 comments on commit 013aded

Please sign in to comment.