From 1b94f84e38f57a90954eda8f1ba7afc350e4fb10 Mon Sep 17 00:00:00 2001 From: Daniel Persson Date: Mon, 14 Oct 2024 20:59:15 +0200 Subject: [PATCH] Add missing test for Commit action Not every message should be responded to. --- test_marvin_actions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test_marvin_actions.py b/test_marvin_actions.py index 8921053..08aa02a 100644 --- a/test_marvin_actions.py +++ b/test_marvin_actions.py @@ -332,6 +332,11 @@ def testCommitResponse(self): expected = f"Använd detta meddelandet: '{message}'" self.assertActionOutput(marvin_actions.marvinCommit, "commit", expected) + def testCommitReaction(self): + """Test that marvin only generates commit messages when asked""" + self.assertActionSilent(marvin_actions.marvinCommit, "nocommit") + + def testCommitError(self): """Tests that marvin sends the proper message when get commit fails""" with mock.patch("marvin_actions.requests.get", side_effect=Exception('API Down!')):