|
5 | 5 | import pytest |
6 | 6 | import requests as rq |
7 | 7 |
|
8 | | -from moodle_painkillers import ( |
9 | | - main, |
10 | | - notify_on_fail, |
11 | | - parse_args, |
12 | | - register_presence_status, |
13 | | -) |
| 8 | +from moodle_painkillers import (main, notify_on_fail, parse_args, |
| 9 | + register_presence_status) |
14 | 10 |
|
15 | 11 |
|
16 | 12 | class TestRegisterPresenceStatus: |
@@ -244,7 +240,9 @@ def failing_func(): |
244 | 240 | assert excinfo.value == test_exception |
245 | 241 |
|
246 | 242 | # Verify send_notification was called with the exception message |
247 | | - mock_send_notification.assert_called_once_with('test error', title='Moodle Presence Registration') |
| 243 | + mock_send_notification.assert_called_once_with( |
| 244 | + "test error", title="Moodle Presence Registration" |
| 245 | + ) |
248 | 246 |
|
249 | 247 | @patch("moodle_painkillers.send_notification") |
250 | 248 | def test_with_arguments(self, mock_send_notification): |
@@ -294,7 +292,9 @@ def test_main_successful_workflow( |
294 | 292 | mock_session_class.assert_called_once_with("test_user", "test_pass") |
295 | 293 | mock_register_presence.assert_called_once_with(mock_session) |
296 | 294 | mock_send_notification.assert_called_once_with( |
297 | | - "Sent presence status!", discord_webhook="test_webhook" |
| 295 | + "Sent presence status!", |
| 296 | + title="Moodle Presence Registration", |
| 297 | + discord_webhook="test_webhook", |
298 | 298 | ) |
299 | 299 |
|
300 | 300 | @patch("moodle_painkillers.send_notification") |
@@ -324,7 +324,9 @@ def test_main_without_webhook( |
324 | 324 |
|
325 | 325 | # Verify notification called with None webhook |
326 | 326 | mock_send_notification.assert_called_once_with( |
327 | | - "Sent presence status!", discord_webhook=None |
| 327 | + "Sent presence status!", |
| 328 | + title="Moodle Presence Registration", |
| 329 | + discord_webhook=None, |
328 | 330 | ) |
329 | 331 |
|
330 | 332 | @patch("moodle_painkillers.register_presence_status") |
|
0 commit comments