Ejemplo n.º 1
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.utility = Utility(self.config)

        self.patch_convert_mapped_letter_drive_to_unc_path = mock.patch("dataio.utility.Utility.convert_mapped_letter_drive_to_unc_path")
        self.mock_convert_mapped_letter_drive_to_unc_path = self.patch_convert_mapped_letter_drive_to_unc_path.start()

        self.patch_DeleteRows_management = mock.patch("arcpy.DeleteRows_management")
        self.mock_DeleteRows_management = self.patch_DeleteRows_management.start()

        self.patch_TruncateTable_management = mock.patch("arcpy.TruncateTable_management")
        self.mock_TruncateTable_management = self.patch_TruncateTable_management.start()
Ejemplo n.º 2
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.utility = Utility(self.config)

        self.patch_Exists = mock.patch("arcpy.Exists")
        self.mock_Exits = self.patch_Exists.start()

        self.patch_date_today = mock.patch.object(self.utility, "date_today")
        self.mock_date_today = self.patch_date_today.start()

        self.patch_todays_gdb_name = mock.patch.object(self.utility,
                                                       "todays_gdb_name")
        self.mock_todays_gdb_name = self.patch_todays_gdb_name.start()
Ejemplo n.º 3
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config

        self.model_catalog = ModelCatalog(self.config)
        self.model_catalog_db_data_io = mock.MagicMock(ModelCatalogDbDataIo)

        self.patch_add_models_from_model_catalog_db = mock.patch("businessclasses.model_catalog.ModelCatalog.add_models_from_model_catalog_db")
        self.mock_add_models_from_model_catalog_db = self.patch_add_models_from_model_catalog_db.start()

        self.simulation1 = mock.MagicMock(Simulation)
        self.simulation2 = mock.MagicMock(Simulation)
        self.simulation3 = mock.MagicMock(Simulation)

        self.model1 = mock.MagicMock(Model)
        self.model1.id = 1
        self.model1.model_purpose_id = self.config.model_purpose_id["Characterization"]
        self.model1.simulations = [self.simulation1]
        self.model1.model_alterations = []
        self.model1.project_types = []
        self.model1.model_path = "model_path1"
        self.model1.create_date = "create_date1"
        self.model1.created_by = "created_by1"

        self.model2 = mock.MagicMock(Model)
        self.model2.id = 2
        self.model2.model_purpose_id = self.config.model_purpose_id["Characterization"]
        self.model2.simulations = [self.simulation2, self.simulation3]
        self.model2.model_alterations = []
        self.model2.project_types = []
        self.model2.model_path = "model_path2"
        self.model2.create_date = "create_date2"
        self.model2.created_by = "created_by2"

        self.model_string1 = self.model1.model_path + "   " + "date string" + "   " + self.model1.created_by + " " + str(self.model1.id)
        self.model_string2 = self.model2.model_path + "   " + "date string" + "   " + self.model2.created_by + " " + str(self.model2.id)

        self.patch_characterization_models = mock.patch("businessclasses.model_catalog.ModelCatalog.characterization_models")
        self.mock_characterization_models = self.patch_characterization_models.start()
        self.mock_characterization_models.return_value = [self.model1, self.model2]

        self.patch_format_date = mock.patch("dataio.utility.Utility.format_date")
        self.mock_format_date = self.patch_format_date.start()
        self.mock_format_date.return_value = "date string"

        self.characterization_reporting = CharacterizationReporting(self.config, self.model_catalog,
                                                                    self.model_catalog_db_data_io)

        self.test_characterization_model = {self.model_string1: self.model1,
                                                                  self.model_string2: self.model2}
Ejemplo n.º 4
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.parent_id = 1
        self.save_changes = True

        self.mock_db_data_io = mock.MagicMock(DbDataIo)
        self.mock_Editor = mock.MagicMock(arcpy.da.Editor)

        self.object_data_io = ObjectDataIo(self.config, self.mock_db_data_io)
        self.object_class = None
        self.field_names_retrieve_id = ["Object_Type", "Current_ID"]

        self.patch_da_InsertCursor = mock.patch("arcpy.da.InsertCursor")
        self.mock_da_InsertCursor = self.patch_da_InsertCursor.start()

        self.mock_generic_object = mock.MagicMock(GenericObject)
        self.mock_generic_object.id = 1
        self.mock_generic_object.name = "name"
        self.mock_generic_object.valid = False

        self.field_attribute_lookup = OrderedDict()
        self.field_attribute_lookup["id_field"] = "id"
        self.field_attribute_lookup["name"] = "name"

        self.object_table_sde_path = "object_tracking_sde_path"

        self.patch_da_Editor = mock.patch("arcpy.da.Editor")
        self.mock_da_Editor = self.patch_da_Editor.start()
        self.mock_da_Editor.return_value = self.mock_Editor

        self.patch_startEditing = mock.patch("arcpy.da.Editor.startEditing")
        self.mock_startEditing = self.patch_startEditing.start()

        self.patch_startOperation = mock.patch(
            "arcpy.da.Editor.startOperation")
        self.mock_startOperation = self.patch_startOperation.start()

        self.patch_stopOperation = mock.patch("arcpy.da.Editor.stopOperation")
        self.mock_stopOperation = self.patch_stopOperation.start()

        self.patch_stopEditing = mock.patch("arcpy.da.Editor.stopEditing")
        self.mock_stopEditing = self.patch_stopEditing.start()
Ejemplo n.º 5
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config

        self.model_catalog = ModelCatalog(self.config)
        self.model_catalog_db_data_io = mock.MagicMock(ModelCatalogDbDataIo)

        self.patch_add_models_from_model_catalog_db = mock.patch(
            "businessclasses.model_catalog.ModelCatalog.add_models_from_model_catalog_db"
        )
        self.mock_add_models_from_model_catalog_db = self.patch_add_models_from_model_catalog_db.start(
        )

        self.model1 = mock.MagicMock(Model)
        self.model1.id = 1
        self.model1.model_alterations = []
        self.model1.project_types = []
        self.model1.model_path = "model_path1"
        self.model1.create_date = "create_date1"
        self.model1.created_by = "created_by1"

        self.model2 = mock.MagicMock(Model)
        self.model2.id = 2
        self.model2.model_alterations = []
        self.model2.project_types = []
        self.model2.model_path = "model_path2"
        self.model2.create_date = "create_date2"
        self.model2.created_by = "created_by2"

        self.model_string1 = self.model1.model_path + "   " + "date string" + "   " + self.model1.created_by + " " + str(
            self.model1.id)
        self.model_string2 = self.model2.model_path + "   " + "date string" + "   " + self.model2.created_by + " " + str(
            self.model2.id)

        self.patch_format_date = mock.patch(
            "dataio.utility.Utility.format_date")
        self.mock_format_date = self.patch_format_date.start()
        self.mock_format_date.return_value = "date string"

        self.model_copy = ModelCopy(self.config, self.model_catalog,
                                    self.model_catalog_db_data_io)
Ejemplo n.º 6
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.mock_db_data_io = mock.Mock()
        self.mock_db_data_io.retrieve_current_id.return_value = 1
        self.model_catalog_data_io = ModelCatalogDbDataIo(self.config)
        self.model_data_io = ModelDataIo(self.config,
                                         self.model_catalog_data_io)
        self.field_names = [
            "Model_ID", "Simulation_ID", "Storm_ID", "Dev_Scenario_ID",
            "Sim_Desc"
        ]

        self.parent_model_path = "parent_model_path"

        self.mock_model_alt_bc = mock.MagicMock(spec=ModelAltBc)
        self.mock_model_alt_hydrologic = mock.MagicMock(
            spec=ModelAltHydrologic)
        self.mock_model_alt_hydraulic = mock.MagicMock(spec=ModelAltHydraulic)
        self.generic_field_attribute_lookup = OrderedDict()
        self.generic_field_attribute_lookup["Generic_ID"] = "id"
        self.generic_field_attribute_lookup[
            "Generic_Domain_ID"] = "generic_domain_id"

        self.mock_model_alt_bc.input_field_attribute_lookup = self.generic_field_attribute_lookup
        self.mock_model_alt_bc.name = "model_alt_bc"
        self.mock_model_alt_hydrologic.input_field_attribute_lookup = self.generic_field_attribute_lookup
        self.mock_model_alt_hydrologic.name = "model_alt_hydrologic"
        self.mock_model_alt_hydraulic.input_field_attribute_lookup = self.generic_field_attribute_lookup
        self.mock_model_alt_hydraulic.name = "model_alt_hydraulic"

        self.mock_simulation = mock.MagicMock(spec=Simulation)
        self.mock_simulation.simulation_id = 22
        self.mock_simulation.storm_id = 33
        self.mock_simulation.dev_scenario_id = 44
        self.mock_simulation.sim_desc = "sim_desc"
        self.mock_simulation.config = self.config
        field_attribute_lookup = OrderedDict()
        field_attribute_lookup[0] = ["Model_ID", "parent_id"]
        field_attribute_lookup[1] = ["Simulation_ID", "id"]
        field_attribute_lookup[2] = ["Storm_ID", "storm_id"]
        field_attribute_lookup[3] = ["Dev_Scenario_ID", "dev_scenario_id"]
        field_attribute_lookup[4] = ["Sim_Desc", "sim_desc"]
        self.mock_simulation.input_field_attribute_lookup = field_attribute_lookup

        self.mock_project_type = mock.MagicMock(spec=ProjectType)
        self.mock_project_type.input_field_attribute_lookup = self.generic_field_attribute_lookup

        self.mock_model = mock.MagicMock(spec=Model)
        self.mock_model.model_path = r"C:\model_path"
        self.mock_model.id = 11
        self.mock_model.valid = True
        self.mock_model.simulations = [self.mock_simulation]
        self.mock_model.project_types = [self.mock_project_type]
        #TODO: This needs a date-time object
        self.mock_model.create_date = "create_date"
        self.mock_model.model_purpose_id = 1

        self.mock_insert_cursor_object = mock.MagicMock(
            spec=arcpy.da.InsertCursor)
        self.mock_search_cursor_object = mock.MagicMock(
            spec=arcpy.da.SearchCursor)
        self.mock_search_cursor_object.__iter__.return_value = iter([["geom"]])

        self.patch_dissolve = mock.patch("arcpy.Dissolve_management")
        self.mock_dissolve = self.patch_dissolve.start()

        self.patch_insert_cursor = mock.patch("arcpy.da.InsertCursor")
        self.mock_insert_cursor = self.patch_insert_cursor.start()

        self.patch_search_cursor = mock.patch("arcpy.da.SearchCursor")
        self.mock_search_cursor = self.patch_search_cursor.start()
        self.mock_search_cursor.return_value = self.mock_search_cursor_object

        self.patch_retrieve_current_id = mock.patch(
            "dataio.db_data_io.DbDataIo.retrieve_current_id")
        self.mock_retrieve_current_id = self.patch_retrieve_current_id.start()
        self.mock_retrieve_current_id.return_value = 1

        self.patch_retrieve_current_simulation_id = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.retrieve_current_simulation_id"
        )
        self.mock_retrieve_current_simulation_id = self.patch_retrieve_current_simulation_id.start(
        )
        self.mock_retrieve_current_simulation_id.return_value = 1

        self.patch_append_object_to_db = mock.patch.object(
            self.model_data_io, "append_object_to_db")
        self.mock_append_object_to_db = self.patch_append_object_to_db.start()

        self.mock_model.simulations = [self.mock_simulation]
        self.mock_model.model_alterations = [self.mock_model_alt_bc]

        self.patch_os_walk = mock.patch("os.walk")
        self.mock_os_walk = self.patch_os_walk.start()

        self.patch_os_chmod = mock.patch("os.chmod")
        self.mock_os_chmod = self.patch_os_chmod.start()

        self.patch_os_access = mock.patch("os.access")
        self.mock_os_access = self.patch_os_access.start()

        self.patch_open = mock.patch("__builtin__.open")
        self.mock_open = self.patch_open.start()

        self.patch_json_dump = mock.patch("json.dump")
        self.mock_json_dump = self.patch_json_dump.start()

        self.patch_valid_emgaats_model_structure = mock.patch.object(
            self.mock_model, "valid_emgaats_model_structure")
        self.mock_valid_emgaats_model_structure = self.patch_valid_emgaats_model_structure.start(
        )
        self.mock_valid_emgaats_model_structure.return_value = True
Ejemplo n.º 7
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config

        self.parent_id_to_db_field_mapping = [(1, "id_field_one"),
                                              (2, "id_field_two")]
        self.db_data_io = DbDataIo(self.config)
        self.object_class = None
        self.field_names_retrieve_id = ["Object_Type", "Current_ID"]

        self.mock_row = (1, 2)
        self.field_attribute_lookup_add_object = OrderedDict([("id_db", "id"),
                                                              ("parent_id_db",
                                                               "parent_id")])

        self.patch_create_object = mock.patch.object(self.db_data_io,
                                                     "create_object")
        self.mock_create_object = self.patch_create_object.start()

        self.patch_create_object_with_current_id = mock.patch.object(
            self.db_data_io, "create_object_with_id")
        self.mock_create_object_with_current_id = self.patch_create_object_with_current_id.start(
        )

        self.patch_delete_management = mock.patch("arcpy.Delete_management")
        self.mock_delete_management = self.patch_delete_management.start()

        self.mock_update_cursor = mock.MagicMock(arcpy.da.UpdateCursor)
        self.mock_update_cursor.__iter__.return_value = iter([
            ("MagicMock", 44), ("GenericObject", 55)
        ])

        self.mock_update_cursor1 = mock.MagicMock(arcpy.da.UpdateCursor)
        row = [1]
        row[0] = 1
        self.mock_update_cursor1.__iter__.return_value = iter([row])

        self.mock_insert_cursor = mock.MagicMock(arcpy.da.InsertCursor)

        self.mock_search_cursor = mock.MagicMock(arcpy.da.SearchCursor)
        self.mock_search_cursor.__iter__.return_value = iter([self.mock_row])

        self.patch_append = mock.patch("arcpy.Append_management")
        self.mock_append = self.patch_append.start()

        self.patch_make_query_table = mock.patch(
            "arcpy.MakeQueryTable_management")
        self.mock_make_query_table = self.patch_make_query_table.start()

        self.patch_copy_features_management = mock.patch(
            "arcpy.CopyFeatures_management")
        self.mock_copy_features_management = self.patch_copy_features_management.start(
        )

        self.patch_add_field_management = mock.patch(
            "arcpy.AddField_management")
        self.mock_add_field_management = self.patch_add_field_management.start(
        )

        self.patch_calculate_field = mock.patch(
            "arcpy.CalculateField_management")
        self.mock_calculate_field = self.patch_calculate_field.start()

        self.patch_da_UpdateCursor = mock.patch("arcpy.da.UpdateCursor")
        self.mock_da_UpdateCursor = self.patch_da_UpdateCursor.start()

        self.patch_da_InsertCursor = mock.patch("arcpy.da.InsertCursor")
        self.mock_da_InsertCursor = self.patch_da_InsertCursor.start()

        self.patch_da_SearchCursor = mock.patch("arcpy.da.SearchCursor")
        self.mock_da_SearchCursor = self.patch_da_SearchCursor.start()
        self.mock_da_SearchCursor.return_value = self.mock_search_cursor

        self.patch_get_count_management = mock.patch(
            "arcpy.GetCount_management")
        self.mock_get_count_management = self.patch_get_count_management.start(
        )
        self.mock_get_count_management.return_value = ["1"]

        self.patch_create_field_map_for_sde_db = mock.patch.object(
            self.db_data_io, "_create_field_map_for_sde_db")
        self.mock_create_field_map_for_sde_db = self.patch_create_field_map_for_sde_db.start(
        )

        self.patch_create_feature_class = mock.patch(
            "arcpy.CreateFeatureclass_management")
        self.mock_create_feature_class = self.patch_create_feature_class.start(
        )

        self.mock_da_InsertCursor.return_value = self.mock_insert_cursor

        self.field_attribute_lookup_add_object = OrderedDict()
        self.field_attribute_lookup_add_object["id_field"] = "id"
        self.field_attribute_lookup_add_object["parent_id_field"] = "parent_id"

        self.field_attribute_lookup_create_object = OrderedDict()
        self.field_attribute_lookup_create_object["id_db"] = "id"
        self.field_attribute_lookup_create_object["parent_id_db"] = "parent_id"

        self.field_attribute_lookup_create_table_from_objects = self.field_attribute_lookup_create_object

        self.mock_generic_object = mock.MagicMock(GenericObject)
        self.mock_generic_object.id = 1
        self.mock_generic_object.valid = False
        self.mock_generic_object.parent_id = 2
        self.mock_generic_object.input_field_attribute_lookup.return_value = self.field_attribute_lookup_create_object

        self.patch_input_field_attribute_lookup = mock.patch(
            "businessclasses.generic_object.GenericObject.input_field_attribute_lookup"
        )
        self.mock_input_field_attribute_lookup = self.patch_input_field_attribute_lookup.start(
        )
        self.mock_input_field_attribute_lookup.return_value = self.field_attribute_lookup_create_table_from_objects

        self.object_tracking_sde_path = "object_tracking_sde_path"
Ejemplo n.º 8
0
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.mock_model_catalog_db_data_io = mock.MagicMock(
            ModelCatalogDbDataIo)
        self.mock_model_catalog_db_data_io.config = self.config
        self.mock_model_catalog_db_data_io.workspace = "in_memory"

        self.path = r"c:\temp\fake\sim\D25yr6h\results.gdb\AreaResults"
        self.simulation_data_io = SimulationDataIo(
            self.config, self.mock_model_catalog_db_data_io)

        self.patch_simulation_path = mock.patch(
            "businessclasses.simulation.Simulation.path")
        self.mock_simulation_path = self.patch_simulation_path.start()

        self.mock_simulation = mock.MagicMock(Simulation)
        self.mock_simulation.storm = "D25yr6h"
        self.mock_simulation.scenario = ""
        self.mock_simulation.id = 1
        self.mock_simulation.storm_id = 22
        self.mock_simulation.dev_scenario_id = 33
        self.mock_simulation.areas = "areas"
        self.mock_simulation.required_for_model_catalog.return_value = True
        self.mock_simulation.sim_desc = "sim_desc"

        self.patch_create_areas = mock.patch.object(self.mock_simulation,
                                                    "create_areas")
        self.mock_create_areas = self.patch_create_areas.start()

        self.patch_add_message = mock.patch("arcpy.AddMessage")
        self.mock_add_message = self.patch_add_message.start()

        self.patch_MakeTableView_management = mock.patch(
            "arcpy.MakeTableView_management")
        self.mock_MakeTableView_management = self.patch_MakeTableView_management.start(
        )

        self.patch_CopyRows = mock.patch("arcpy.CopyRows_management")
        self.mock_CopyRows = self.patch_CopyRows.start()

        self.mock_model = mock.MagicMock(Model)
        self.simulation = Simulation(self.config)
        self.patch_simulation_path = mock.patch(
            "businessclasses.simulation.Simulation.path")
        self.mock_simulation_path = self.patch_simulation_path.start()
        self.mock_simulation_path.return_value = self.path

        self.model_catalog_db_data_io = ModelCatalogDbDataIo(self.config)

        self.patch_start_editing_session = mock.patch(
            "dataio.simulation_data_io.SimulationDataIo.start_editing_session")
        self.mock_start_editing_session = self.patch_start_editing_session.start(
        )
        self.mock_start_editing_session.return_value = "editor"

        self.patch_stop_editing_session = mock.patch(
            "dataio.simulation_data_io.SimulationDataIo.stop_editing_session")
        self.mock_stop_editing_session = self.patch_stop_editing_session.start(
        )

        self.patch_copy_to_memory = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.copy_to_memory"
        )
        self.mock_copy_to_memory = self.patch_copy_to_memory.start()

        self.patch_add_ids = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.add_ids")
        self.mock_add_ids = self.patch_add_ids.start()

        self.patch_add_parent_id = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.add_parent_id"
        )
        self.mock_add_parent_id = self.patch_add_parent_id.start()

        self.patch_append_objects_to_db = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.append_objects_to_db"
        )
        self.mock_append_objects_to_db = self.patch_append_objects_to_db.start(
        )

        self.patch_append_data_to_db = mock.patch(
            "dataio.model_catalog_db_data_io.ModelCatalogDbDataIo.append_table_to_db"
        )
        self.mock_append_data_to_db = self.patch_append_data_to_db.start()
    def setUp(self):
        mock_config = MockConfig()
        self.config = mock_config.config
        self.model_catalog_db_data_io = ModelCatalogDbDataIo(self.config)
        self.model_catalog = mock.MagicMock(ModelCatalog)
        self.model = mock.MagicMock(Model)
        self.model_data_io = ModelDataIo(self.config,
                                         self.model_catalog_db_data_io)
        self.simulation_data_io = SimulationDataIo(
            self.config, self.model_catalog_db_data_io)
        self.model.model_id = 0
        self.model.parent_model_id = 0
        self.model.model_request_id = 0
        self.model.project_phase_id = None
        self.model.engine_type_id = None
        self.model.create_date = None
        self.model.deploy_date = None
        self.model.run_date = None
        self.model.extract_date = None
        self.model.created_by = None
        self.model.model_path = None
        self.model.project_type_id = None
        self.model.model_purpose_id = None
        self.model.model_calibration_file = None
        self.model.model_status_id = self.config.model_status_id["Final"]
        self.model.model_alteration_file = None
        self.model.project_num = None
        self.model.model_geometry = None

        self.mock_update_cursor = mock.MagicMock(arcpy.da.UpdateCursor)
        self.mock_update_cursor.__iter__.return_value = iter([
            ("Model", 44), ("Simulation", 55), ("ModelAlteration", 66)
        ])
        self.patch_da_UpdateCursor = mock.patch("arcpy.da.UpdateCursor")
        self.mock_da_UpdateCursor = self.patch_da_UpdateCursor.start()

        self.patch_da_InsertCursor = mock.patch("arcpy.da.InsertCursor")
        self.mock_da_InsertCursor = self.patch_da_InsertCursor.start()

        self.patch_append_object_to_db = mock.patch.object(
            self.model_catalog_db_data_io, "append_object_to_db")
        self.mock_append_object_to_db = self.patch_append_object_to_db.start()

        self.patch_read_simulations = mock.patch(
            "dataio.model_data_io.ModelDataIo.read_simulations")
        self.mock_read_simulations = self.patch_read_simulations.start()

        self.patch_append_simulations = mock.patch(
            "dataio.model_data_io.ModelDataIo.append_simulations")
        self.mock_append_simulations = self.patch_append_simulations.start()

        self.patch_append_model_alterations = mock.patch(
            "dataio.model_data_io.ModelDataIo.append_model_alterations")
        self.mock_append_model_alterations = self.patch_append_model_alterations.start(
        )

        self.patch_append_project_types = mock.patch(
            "dataio.model_data_io.ModelDataIo.append_project_types")
        self.mock_append_project_types = self.patch_append_project_types.start(
        )

        self.patch_start_editing_session = mock.patch(
            "dataio.model_data_io.ModelDataIo.start_editing_session")
        self.mock_start_editing_session = self.patch_start_editing_session.start(
        )

        self.mock_start_editing_session.return_value = "editor"

        self.patch_stop_editing_session = mock.patch(
            "dataio.model_data_io.ModelDataIo.stop_editing_session")
        self.mock_stop_editing_session = self.patch_stop_editing_session.start(
        )

        self.patch_set_registered_model_to_read_only = mock.patch(
            "dataio.model_data_io.ModelDataIo.set_registered_model_to_read_only"
        )
        self.mock_set_registered_model_to_read_only = self.patch_set_registered_model_to_read_only.start(
        )

        self.patch_write_model_registration_file = mock.patch(
            "dataio.model_data_io.ModelDataIo.write_model_registration_file")
        self.mock_write_model_registration_file = self.patch_write_model_registration_file.start(
        )

        self.patch_append_model_network = mock.patch(
            "dataio.model_data_io.ModelDataIo.append_model_network")
        self.mock_append_model_network = self.patch_append_model_network.start(
        )

        self.patch_append_simulation_results = mock.patch(
            "dataio.simulation_data_io.SimulationDataIo.append_simulation_results"
        )
        self.mock_append_simulation_results = self.patch_append_simulation_results.start(
        )