2023-05-15 17:24:44 +00:00
|
|
|
import pytest
|
|
|
|
|
2023-08-10 18:07:41 +00:00
|
|
|
from moto.sns.utils import FilterPolicyMatcher
|
|
|
|
|
2023-05-15 17:24:44 +00:00
|
|
|
|
|
|
|
def test_filter_policy_matcher_scope_sanity_check():
|
|
|
|
with pytest.raises(FilterPolicyMatcher.CheckException):
|
|
|
|
FilterPolicyMatcher({}, "IncorrectFilterPolicyScope")
|
|
|
|
|
|
|
|
|
|
|
|
def test_filter_policy_matcher_empty_message_attributes():
|
|
|
|
matcher = FilterPolicyMatcher({}, None)
|
|
|
|
assert matcher.matches(None, "")
|
|
|
|
|
|
|
|
|
|
|
|
def test_filter_policy_matcher_empty_message_attributes_filtering_fail():
|
|
|
|
matcher = FilterPolicyMatcher({"store": ["test"]}, None)
|
|
|
|
assert not matcher.matches(None, "")
|