-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for aligning Slack message grouping intervals
- Loading branch information
Robert Szefler
committed
Jun 25, 2024
1 parent
50f7f84
commit ea1839d
Showing
4 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
from datetime import datetime, timezone | ||
|
||
from robusta.core.sinks.sink_base import NotificationSummary | ||
|
||
|
||
utc = timezone.utc | ||
|
||
|
||
class TestNotificationSummary: | ||
@pytest.mark.parametrize("input_dt,expected_output", [ | ||
(datetime(2024, 6, 25, 12, 15, 33, tzinfo=utc), (1719273600, 1719360000)), | ||
(datetime(2024, 6, 30, 17, 22, 19, tzinfo=utc), (1719705600, 1719792000)), | ||
(datetime(2024, 12, 3, 10, 59, 59, tzinfo=utc), (1733184000, 1733270400)), | ||
(datetime(2024, 12, 31, 16, 42, 28, tzinfo=utc), (1735603200, 1735689600)), | ||
]) | ||
def test_get_day_boundaries(self, input_dt, expected_output): | ||
assert NotificationSummary.get_day_boundaries(input_dt) == expected_output |