Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 13, 2024
1 parent 5900554 commit f8ad379
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,8 @@ void Task::validate(bool applyDefault /* = true */) {
// Pending tasks cannot have an end date, remove if present
if ((status == Task::pending) && (get("end") != "")) {
remove("end");
throw format("Could not modify task {1}. You cannot set an end date on a pending task.", this->id);
throw format("Could not modify task {1}. You cannot set an end date on a pending task.",
this->id);
}

// Provide a modified date unless user already specified one.
Expand Down
6 changes: 5 additions & 1 deletion test/modify.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_mod_nop(self):
code, out, err = self.t("1 modify due:")
self.assertIn("Modified 0 tasks.", out)


class TestBug3584(TestCase):
def setUp(self):
self.t = Task()
Expand All @@ -63,7 +64,10 @@ def test_mod_pending_task_end_date(self):
"""Adding the end date for a pending task throws an error"""
self.t("add foo")
code, out, err = self.t.runError("1 modify end:1d")
self.assertIn("Could not modify task 1. You cannot set an end date on a pending task.", err)
self.assertIn(
"Could not modify task 1. You cannot set an end date on a pending task.",
err,
)


if __name__ == "__main__":
Expand Down

0 comments on commit f8ad379

Please sign in to comment.