File tree Expand file tree Collapse file tree 2 files changed +17
-16
lines changed
Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 44from .test_external_stix20_bundles import TestExternalSTIX20Bundles
55from ._test_stix import TestSTIX20
66from ._test_stix_import import TestExternalSTIX2Import , TestSTIX20Import
7+ from datetime import datetime
78from uuid import uuid5
89
910
@@ -90,14 +91,14 @@ def test_stix20_bundle_with_campaign_galaxy(self):
9091 attribute = event .attributes [0 ]
9192 self .assertEqual (attribute .uuid , indicator .id .split ('--' )[1 ])
9293 meta = self ._check_galaxy_features (attribute .galaxies , attribute_campaign )
93- self .assertEqual (
94- meta ,
95- {
96- 'first_seen' : attribute_campaign . first_seen ,
97- 'created' : attribute_campaign . created ,
98- 'modified' : attribute_campaign . modified
99- }
100- )
94+ self .assertTrue ( meta [ 'first_seen' ] == attribute_campaign . first_seen )
95+ for field in ( 'created' , 'modified' ):
96+ self . assertEqual (
97+ meta [ field ] ,
98+ datetime . strftime (
99+ getattr ( attribute_campaign , field ), '%Y-%m-%dT%H:%M:%S.%fZ'
100+ )
101+ )
101102
102103 def test_stix20_bundle_with_course_of_action_galaxy (self ):
103104 bundle = TestExternalSTIX20Bundles .get_bundle_with_course_of_action_galaxy ()
Original file line number Diff line number Diff line change @@ -111,14 +111,14 @@ def test_stix21_bundle_with_campaign_galaxy(self):
111111 attribute = event .attributes [0 ]
112112 self .assertEqual (attribute .uuid , indicator .id .split ('--' )[1 ])
113113 meta = self ._check_galaxy_features (attribute .galaxies , attribute_campaign )
114- self .assertEqual (
115- meta ,
116- {
117- 'first_seen' : attribute_campaign . first_seen ,
118- 'created' : attribute_campaign . created ,
119- 'modified' : attribute_campaign . modified
120- }
121- )
114+ self .assertTrue ( meta [ 'first_seen' ] == attribute_campaign . first_seen )
115+ for field in ( 'created' , 'modified' ):
116+ self . assertEqual (
117+ meta [ field ] ,
118+ datetime . strftime (
119+ getattr ( attribute_campaign , field ), '%Y-%m-%dT%H:%M:%S.%fZ'
120+ )
121+ )
122122
123123 def test_stix21_bundle_with_course_of_action_galaxy (self ):
124124 bundle = TestExternalSTIX21Bundles .get_bundle_with_course_of_action_galaxy ()
You can’t perform that action at this time.
0 commit comments