Skip to content

Commit 5b6fc6c

Browse files
committed
fix: [tests] Removed overlapping tests already executed while checking the galaxy cluster fields
1 parent 835256c commit 5b6fc6c

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

tests/test_external_stix20_import.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,7 @@ def test_stix20_bundle_with_campaign_galaxy(self):
8989
self.assertEqual(len(event.attributes), 1)
9090
attribute = event.attributes[0]
9191
self.assertEqual(attribute.uuid, indicator.id.split('--')[1])
92-
meta = self._check_galaxy_features(attribute.galaxies, attribute_campaign)
93-
self.assertTrue(meta['first_seen'] == attribute_campaign.first_seen)
94-
for field in ('created', 'modified'):
95-
self.assertEqual(
96-
meta[field],
97-
datetime.strftime(
98-
getattr(attribute_campaign, field), '%Y-%m-%dT%H:%M:%S.%fZ'
99-
)
100-
)
92+
self._check_galaxy_features(attribute.galaxies, attribute_campaign)
10193

10294
def test_stix20_bundle_with_course_of_action_galaxy(self):
10395
bundle = TestExternalSTIX20Bundles.get_bundle_with_course_of_action_galaxy()

tests/test_external_stix21_import.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,7 @@ def test_stix21_bundle_with_campaign_galaxy(self):
220220
self.assertEqual(len(event.attributes), 1)
221221
attribute = event.attributes[0]
222222
self.assertEqual(attribute.uuid, indicator.id.split('--')[1])
223-
meta = self._check_galaxy_features(attribute.galaxies, attribute_campaign)
224-
self.assertTrue(meta['first_seen'] == attribute_campaign.first_seen)
225-
for field in ('created', 'modified'):
226-
self.assertEqual(
227-
meta[field],
228-
datetime.strftime(
229-
getattr(attribute_campaign, field), '%Y-%m-%dT%H:%M:%S.%fZ'
230-
)
231-
)
223+
self._check_galaxy_features(attribute.galaxies, attribute_campaign)
232224

233225
def test_stix21_bundle_with_course_of_action_galaxy(self):
234226
bundle = TestExternalSTIX21Bundles.get_bundle_with_course_of_action_galaxy()

0 commit comments

Comments
 (0)