Skip to content

Commit

Permalink
Addjust test to updated design matrix initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Oct 17, 2024
1 parent b399e41 commit be55192
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/ert/unit_tests/gui/simulation/test_run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from queue import SimpleQueue
from unittest.mock import MagicMock, Mock, patch

import pandas as pd
import pytest
from pytestqt.qtbot import QtBot
from qtpy import QtWidgets
Expand Down Expand Up @@ -719,15 +720,26 @@ def test_that_stdout_and_stderr_buttons_react_to_file_content(
def test_that_design_matrix_show_parameters_button_is_visible(
design_matrix_entry, qtbot: QtBot, storage
):
xls_filename = "design_matrix.xls"
with open(f"{xls_filename}", "w", encoding="utf-8"):
pass
xls_filename = "design_matrix.xlsx"
design_matrix_df = pd.DataFrame(
{
"REAL": list(range(3)),
"a": [0, 1, 2],
}
)
default_sheet_df = pd.DataFrame([["b", 1], ["c", 2]])
with pd.ExcelWriter(xls_filename) as xl_write:
design_matrix_df.to_excel(xl_write, index=False, sheet_name="DesignSheet01")
default_sheet_df.to_excel(
xl_write, index=False, sheet_name="DefaultSheet", header=False
)

config_file = "minimal_config.ert"
with open(config_file, "w", encoding="utf-8") as f:
f.write("NUM_REALIZATIONS 1")
if design_matrix_entry:
f.write(
f"\nDESIGN_MATRIX {xls_filename} DESIGN_SHEET:DesignSheet01 DEFAULT_SHEET:DefaultValues"
f"\nDESIGN_MATRIX {xls_filename} DESIGN_SHEET:DesignSheet01 DEFAULT_SHEET:DefaultSheet"
)

args_mock = Mock()
Expand Down

0 comments on commit be55192

Please sign in to comment.