-
-
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.
add some more tests to make sure everything is working as expected
- Loading branch information
1 parent
e2cfa38
commit 5c51398
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from unittest import mock | ||
|
||
import pytest | ||
|
||
from sentry.workflow_engine.registry import data_source_type_registry | ||
from tests.sentry.workflow_engine.test_base import BaseWorkflowTest | ||
|
||
|
||
class DataSourceTest(BaseWorkflowTest): | ||
def test_inavlid_data_source_type(self): | ||
with pytest.raises(ValueError): | ||
self.create_data_source(type="invalid_type") | ||
|
||
def test_data_source_valid_type(self): | ||
test_type = "test" | ||
type_mock = mock.Mock() | ||
|
||
data_source_type_registry.register(test_type)(type_mock) | ||
assert data_source_type_registry.get(test_type) == type_mock | ||
|
||
data_source = self.create_data_source(type=test_type) | ||
|
||
assert data_source is not None |
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