Skip to content

Commit

Permalink
fix: [tests] Cleaned up tests for analyst data export
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisr3d committed Oct 10, 2024
1 parent 9ea626c commit 6743ad7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions tests/test_stix20_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ def _test_event_with_analyst_data(self, event):
self.assertEqual(report.published, timestamp)
for stix_object, object_ref in zip(stix_objects, object_refs):
self.assertEqual(stix_object.id, object_ref)
for stix_object in stix_objects:
print(stix_object.type)
(attr_indicator, attr_opinion, observed_data, observed_data_note,
obj_indicator, obj_opinion, obj_attr_note, report, report_opinion,
relationship, event_note) = stix_objects
Expand Down Expand Up @@ -194,7 +192,7 @@ def _test_event_with_event_report(self, event):
orgc = event['Orgc']
event_report = event['EventReport'][0]
self.parser.parse_misp_event(event)
bundle = self._check_bundle_features(9)
bundle = self._check_bundle_features(7)
identity, report, *stix_objects = bundle.objects
timestamp = event['timestamp']
if not isinstance(timestamp, datetime):
Expand All @@ -204,7 +202,7 @@ def _test_event_with_event_report(self, event):
self.assertEqual(report.published, timestamp)
for stix_object, object_ref in zip(stix_objects, object_refs):
self.assertEqual(stix_object.id, object_ref)
attack_pattern, ip_src, observed_data, domain_ip, note, _, marking = stix_objects
ip_src, observed_data, domain_ip, note, _ = stix_objects
self.assertEqual(note.id, f"x-misp-event-report--{event_report['uuid']}")
timestamp = event_report['timestamp']
if not isinstance(timestamp, datetime):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_stix21_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ def _test_event_with_analyst_data(self, event):
object_refs = self._check_grouping_features(grouping, event, identity_id)
for stix_object, object_ref in zip(stix_objects, object_refs):
self.assertEqual(stix_object.id, object_ref)
for stix_object in stix_objects:
print(stix_object.type)
(attr_indicator, attr_indicator_opinion, observed_data, _,
_, obs_data_note, obj_indicator, obj_opinion, obj_attr_note,
report, report_opinion, relationship, event_note) = stix_objects
Expand Down Expand Up @@ -264,7 +262,7 @@ def _test_event_with_event_report(self, event):
timestamp = event_report['timestamp']
if not isinstance(timestamp, datetime):
timestamp = self._datetime_from_timestamp(timestamp)
self.assertEqual(note.created, timestamp)
self._assert_multiple_equal(note.created, note.modified, timestamp)
self.assertEqual(note.content, event_report['content'])
object_refs = note.object_refs
self.assertEqual(len(object_refs), 3)
Expand Down

0 comments on commit 6743ad7

Please sign in to comment.