-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move some shared code around to top level test_base and finish test t…
…hat validates process_data_packet
- Loading branch information
1 parent
67be3f2
commit b9f8d52
Showing
7 changed files
with
85 additions
and
37 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
21 changes: 21 additions & 0 deletions
21
tests/sentry/workflow_engine/processors/test_data_packet.py
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,21 @@ | ||
from sentry.workflow_engine.processors.data_packet import process_data_packets | ||
from sentry.workflow_engine.types import DetectorPriorityLevel | ||
from tests.sentry.workflow_engine.test_base import BaseWorkflowTest | ||
|
||
|
||
class TestProcessDataPacket(BaseWorkflowTest): | ||
def setUp(self): | ||
self.snuba_query = self.create_snuba_query() | ||
|
||
(self.workflow, self.detector, self.detector_workflow, self.workflow_triggers) = ( | ||
self.create_detector_and_workflow() | ||
) | ||
|
||
self.data_source, self.data_packet = self.create_test_query_data_source(self.detector) | ||
|
||
def test_single_data_packet(self): | ||
results = process_data_packets([self.data_packet], "snuba_query_subscription") | ||
assert len(results) == 1 | ||
|
||
detector, detector_evaluation_result = results[0] | ||
assert detector_evaluation_result[None].priority == DetectorPriorityLevel.HIGH |
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