Esempio n. 1
0
 def __eq__(self, other):
     return (isinstance(other, self.__class__)
             and string_utils.is_one_dict_is_subset_another_dict(
                 self.custom_attributes, other.custom_attributes)
             and self.slug == other.slug and self.title == other.title
             and self.type == other.type
             and self.updated_at == other.updated_at)
Esempio n. 2
0
 def __eq__(self, other):
     return (isinstance(other, self.__class__)
             and self.assessor == other.assessor
             and self.creator == other.creator
             and string_utils.is_one_dict_is_subset_another_dict(
                 self.custom_attributes, other.custom_attributes) and
             self.objects_under_assessment == other.objects_under_assessment
             and self.os_state == other.os_state
             and self.owners == other.owners and self.slug == other.slug
             and self.status == other.status and self.title == other.title
             and self.type == other.type
             and self.updated_at == other.updated_at
             and self.verifier == other.verifier
             and self.verified == other.verified)
Esempio n. 3
0
 def assert_for_snapshotable_controls(expected_controls, actual_controls):
   """Specific assert method for snapshotable Controls due of issue
   in app GGRC-2344.
   """
   expected_controls = string_utils.convert_to_list(expected_controls)
   actual_controls = string_utils.convert_to_list(actual_controls)
   expected_controls_wo_cas = [
       expected_control.update_attrs(custom_attributes={None: None})
       for expected_control in expected_controls]
   actual_controls_wo_cas = [
       actual_control.update_attrs(custom_attributes={None: None})
       for actual_control in actual_controls]
   assert expected_controls_wo_cas == actual_controls_wo_cas, (
       messages.ERR_MSG_FORMAT.format(
           expected_controls_wo_cas, actual_controls_wo_cas))
   assert (True if (all(string_utils.is_one_dict_is_subset_another_dict(
       exp_ctrl.custom_attributes, act_ctrl.custom_attributes) for
       exp_ctrl, act_ctrl in zip(expected_controls, actual_controls))) else
       pytest.xfail(reason="Issue in app GGRC-2344"))
Esempio n. 4
0
 def assert_for_snapshotable_controls(expected_controls, actual_controls):
     """Specific assert method for snapshotable Controls due of issue
 in app GGRC-2344.
 """
     expected_controls = string_utils.convert_to_list(expected_controls)
     actual_controls = string_utils.convert_to_list(actual_controls)
     expected_controls_wo_cas = [
         expected_control.update_attrs(custom_attributes={None: None})
         for expected_control in expected_controls
     ]
     actual_controls_wo_cas = [
         actual_control.update_attrs(custom_attributes={None: None})
         for actual_control in actual_controls
     ]
     assert expected_controls_wo_cas == actual_controls_wo_cas, (
         messages.ERR_MSG_FORMAT.format(expected_controls_wo_cas,
                                        actual_controls_wo_cas))
     assert (True if (all(
         string_utils.is_one_dict_is_subset_another_dict(
             exp_ctrl.custom_attributes, act_ctrl.custom_attributes)
         for exp_ctrl, act_ctrl in zip(expected_controls, actual_controls)))
             else pytest.xfail(reason="Issue in app GGRC-2344"))