This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NON-JIRA: problem_with_filtering_one_table_should_not_spoil_the_whole…
…_SLI_processing
- Loading branch information
1 parent
421b76f
commit 5a85d7f
Showing
2 changed files
with
31 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unittest | ||
|
||
from mock import patch | ||
|
||
from src.slo.x_days_sli.sli_results_streamer import SLIResultsStreamer | ||
from src.slo.x_days_sli.sli_table_exists_filter import SLITableExistsFilter | ||
from src.slo.x_days_sli.sli_view_querier import SLIViewQuerier | ||
from src.slo.x_days_sli.x_days_sli_service import XDaysSLIService | ||
|
||
|
||
class TestXDaysSLIService(unittest.TestCase): | ||
|
||
@patch.object(SLIViewQuerier, 'query', return_value=[ | ||
{"projectId":"p1", "datasetId":"d1", "tableId":"t1", "partitionId":"part1"} | ||
]) | ||
@patch.object(SLITableExistsFilter, 'exists', side_effect=Exception("An error")) | ||
@patch.object(SLIResultsStreamer, 'stream') | ||
def test_table_that_caused_exception_should_not_be_filtered_out(self, stream, _, query): | ||
XDaysSLIService(3).recalculate_sli() | ||
stream.assert_called_with([{"projectId":"p1", "datasetId":"d1", "tableId":"t1", "partitionId":"part1"}]) |