Ejemplo n.º 1
0
 def test_role_not_found(self, mock_remove):
     mock_remove.side_effect = acl_lib.AclRoleNotFound("role_id")
     assert_raise_library_error(
         lambda: cmd_acl.remove_role(self.mock_env, "role_id", True),
         (Severities.ERROR, report_codes.ID_NOT_FOUND, {"id": "role_id", "id_description": "role"}),
     )
     self.assert_get_cib_called()
     mock_remove.assert_called_once_with(self.cib, "role_id", True)
     self.assert_cib_not_pushed()
Ejemplo n.º 2
0
 def test_role_not_found(self, mock_remove):
     mock_remove.side_effect = acl_lib.AclRoleNotFound("role_id")
     assert_raise_library_error(
         lambda: cmd_acl.remove_role(self.mock_env, "role_id", True),
         (Severities.ERROR, report_codes.ID_NOT_FOUND, {
             "id": "role_id",
             "id_description": "role",
         }))
     self.assert_get_cib_called()
     mock_remove.assert_called_once_with(self.cib, "role_id", True)
     self.assert_cib_not_pushed()
Ejemplo n.º 3
0
 def test_success_autodelete(self, mock_remove):
     cmd_acl.remove_role(self.mock_env, "role_id", True)
     self.assert_get_cib_called()
     mock_remove.assert_called_once_with(self.cib, "role_id", True)
     self.assert_same_cib_pushed()
Ejemplo n.º 4
0
 def test_success_autodelete(self, mock_remove):
     cmd_acl.remove_role(self.mock_env, "role_id", True)
     self.assert_get_cib_called()
     mock_remove.assert_called_once_with(self.cib, "role_id", True)
     self.assert_same_cib_pushed()