From 638689c4816bf610c5149a1f4a2968ed440d486b Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Wed, 7 Jul 2021 13:03:13 -0400 Subject: [PATCH] Add another check to the test_toplevel_ext_prop_meta() unit test. --- stix2/test/v21/test_custom.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stix2/test/v21/test_custom.py b/stix2/test/v21/test_custom.py index f35b02d..fcb573b 100644 --- a/stix2/test/v21/test_custom.py +++ b/stix2/test/v21/test_custom.py @@ -1854,6 +1854,20 @@ def test_toplevel_ext_prop_meta(): }, ) + with pytest.raises(InvalidValueError): + stix2.v21.Identity( + name="test", + intprop=1, + extensions={ + ext_def_id: { + "extension_type": "toplevel-property-extension", + # Use of a defined property, but intended for the + # top level. This should still error out. + "intprop": 1, + }, + }, + ) + with pytest.raises(MissingPropertiesError): stix2.v21.Identity( name="test",