File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,18 @@ def test_granular_example_with_bad_selector():
170170 assert str (excinfo .value ) == "Invalid value for GranularMarking 'selectors': must adhere to selector syntax."
171171
172172
173+ def test_granular_marking_mutual_exclusion_error ():
174+ with pytest .raises (stix2 .exceptions .MutuallyExclusivePropertiesError ) as excinfo :
175+ stix2 .v21 .GranularMarking (
176+ lang = "en" ,
177+ marking_ref = stix2 .TLP_GREEN ,
178+ selectors = ["foo" ]
179+ )
180+ assert excinfo .value .cls == stix2 .v21 .GranularMarking
181+ assert excinfo .value .properties == ["lang" , "marking_ref" ]
182+ assert 'are mutually exclusive' in str (excinfo .value )
183+
184+
173185def test_campaign_with_granular_markings_example ():
174186 campaign = stix2 .v21 .Campaign (
175187 id = "campaign--8e2e2d2b-17d4-4cbf-938f-98ee46b3cd3f" ,
You can’t perform that action at this time.
0 commit comments