@@ -172,7 +172,7 @@ def _check_attack_pattern_object(self, attack_pattern, misp_object, identity_id)
172172 self .assertEqual (attack_pattern .type , 'attack-pattern' )
173173 self .assertEqual (attack_pattern .created_by_ref , identity_id )
174174 self ._check_killchain (attack_pattern .kill_chain_phases [0 ], misp_object ['meta-category' ])
175- self ._check_object_labels (misp_object , attack_pattern .labels , to_ids = False )
175+ self ._check_object_labels (misp_object , attack_pattern .labels )
176176 timestamp = misp_object ['timestamp' ]
177177 if not isinstance (timestamp , datetime ):
178178 timestamp = self ._datetime_from_timestamp (timestamp )
@@ -212,11 +212,7 @@ def _check_attribute_indicator_features(self, indicator, attribute, identity_id,
212212 self ._check_indicator_time_features (indicator , attribute ['timestamp' ])
213213
214214 def _check_attribute_labels (self , attribute , labels ):
215- if attribute .get ('to_ids' ):
216- type_label , category_label , ids_label = labels
217- self .assertEqual (ids_label , f'misp:to_ids="{ attribute ["to_ids" ]} "' )
218- else :
219- type_label , category_label = labels
215+ type_label , category_label = labels
220216 self .assertEqual (type_label , f'misp:type="{ attribute ["type" ]} "' )
221217 self .assertEqual (category_label , f'misp:category="{ attribute ["category" ]} "' )
222218
@@ -564,21 +560,17 @@ def _check_malware_meta_fields(self, stix_object, meta):
564560 def _check_object_indicator_features (self , indicator , misp_object , identity_id , object_ref ):
565561 self ._check_indicator_features (indicator , identity_id , object_ref , misp_object ['uuid' ])
566562 self ._check_killchain (indicator .kill_chain_phases [0 ], misp_object ['meta-category' ])
567- self ._check_object_labels (misp_object , indicator .labels , to_ids = True )
563+ self ._check_object_labels (misp_object , indicator .labels )
568564 self ._check_indicator_time_features (indicator , misp_object ['timestamp' ])
569565
570- def _check_object_labels (self , misp_object , labels , to_ids = None ):
571- if to_ids is not None :
572- name_label , category_label , ids_label = labels
573- self .assertEqual (ids_label , f'misp:to_ids="{ to_ids } "' )
574- else :
575- name_label , category_label = labels
566+ def _check_object_labels (self , misp_object , labels ):
567+ name_label , category_label = labels
576568 self .assertEqual (name_label , f'misp:name="{ misp_object ["name" ]} "' )
577569 self .assertEqual (category_label , f'misp:meta-category="{ misp_object ["meta-category" ]} "' )
578570
579571 def _check_object_observable_features (self , observed_data , misp_object , identity_id , object_ref ):
580572 self ._check_observable_features (observed_data , identity_id , object_ref , misp_object ['uuid' ])
581- self ._check_object_labels (misp_object , observed_data .labels , to_ids = False )
573+ self ._check_object_labels (misp_object , observed_data .labels )
582574 self ._check_observable_time_features (observed_data , misp_object ['timestamp' ])
583575
584576 def _check_object_vulnerability_features (self , vulnerability , misp_object , identity_id , object_ref ):
@@ -587,7 +579,7 @@ def _check_object_vulnerability_features(self, vulnerability, misp_object, ident
587579 )
588580 self .assertEqual (vulnerability .type , 'vulnerability' )
589581 self .assertEqual (vulnerability .created_by_ref , identity_id )
590- self ._check_object_labels (misp_object , vulnerability .labels , to_ids = False )
582+ self ._check_object_labels (misp_object , vulnerability .labels )
591583 timestamp = misp_object ['timestamp' ]
592584 if not isinstance (timestamp , datetime ):
593585 timestamp = self ._datetime_from_timestamp (timestamp )
@@ -883,7 +875,7 @@ def _remove_object_ids_flags(event):
883875 def _run_custom_attribute_tests (self , attribute , custom_object , object_ref , identity_id ):
884876 attribute_type = attribute ['type' ]
885877 category = attribute ['category' ]
886- custom_type = f" x-misp-attribute"
878+ custom_type = ' x-misp-attribute'
887879 self .assertEqual (custom_object .type , custom_type )
888880 self ._assert_multiple_equal (
889881 custom_object .id ,
@@ -893,8 +885,6 @@ def _run_custom_attribute_tests(self, attribute, custom_object, object_ref, iden
893885 self .assertEqual (custom_object .created_by_ref , identity_id )
894886 self .assertEqual (custom_object .labels [0 ], f'misp:type="{ attribute_type } "' )
895887 self .assertEqual (custom_object .labels [1 ], f'misp:category="{ category } "' )
896- if attribute .get ('to_ids' , False ):
897- self .assertEqual (custom_object .labels [2 ], 'misp:to_ids="True"' )
898888 self .assertEqual (custom_object .x_misp_type , attribute_type )
899889 self .assertEqual (custom_object .x_misp_category , category )
900890 if attribute .get ('comment' ):
0 commit comments