Skip to content

Commit f2e21ba

Browse files
author
Bryan Worrell
committed
Updated MarkingStructure tests.
* MarkingStructure is not abstract and does not need an xsi:type value. As such, I removed the unit tests that verified that xsi:type was required. * @id and @idref are not allowed at the same time, so I updated the unit tests to reflect that.
1 parent d881ec1 commit f2e21ba

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

stix/test/data_marking_test.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MarkingSpecificationTests(EntityTestCase, unittest.TestCase):
1212
klass = dm.MarkingSpecification
1313
_full_dict = {
1414
'id': "foo",
15-
'idref': "foo_ref",
15+
# 'idref': "foo_ref", # Cannot have both @id and @idref set at the same time.
1616
'version': "1234",
1717
'controlled_structure': "some xpath",
1818
'marking_structures': [
@@ -26,21 +26,13 @@ class MarkingSpecificationTests(EntityTestCase, unittest.TestCase):
2626

2727
class MarkingStructureTests(unittest.TestCase):
2828

29-
def test_xsi_type_required(self):
30-
d = {
31-
'marking_model_name': 'TLP',
32-
}
33-
34-
# If there's not an xsi:type in the dict, this will raise an error.
35-
self.assertRaises(ValueError, dm.MarkingStructure.from_dict, d)
36-
37-
def test_xsi_type_required(self):
29+
def test_bad_xsi_type(self):
3830
d = {
3931
'marking_model_name': 'TLP',
4032
'xsi:type': "UNKNOWN_XSI_TYPE",
4133
}
4234

43-
self.assertRaises(ValueError, dm.MarkingStructure.from_dict, d)
35+
self.assertRaises(ValueError, dm.MarkingStructureFactory.from_dict, d)
4436

4537

4638
class MarkingTests(EntityTestCase, unittest.TestCase):

0 commit comments

Comments
 (0)