Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/6809.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test_configure_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ def apply_config_to_edb(self, config_path, test_folder=None):
selected_edb = self.selected_edb
settings.logger.info(f"target EDB: {selected_edb}")
app = Edb(edbpath=str(selected_edb), edbversion=self.aedt_info.version)
app.configuration.load(config_path)
app.configuration.run()

temp_dir = Path(tempfile.TemporaryDirectory(suffix=".ansys").name, dir=test_folder)
temp_dir.mkdir()

new_name = create_new_edb_name(Path(app.edbpath).stem) + ".aedb"
app.save_as(str(temp_dir / new_name))
app.configuration.load(config_path)
app.configuration.run()
app.save()
app.close()
return app.edbpath

Expand Down
5 changes: 2 additions & 3 deletions tests/system/extensions/test_configure_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import GUIDE_LINK
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import INTRO_LINK
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import ConfigureLayoutExtension
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.template import SERDES_CONFIG
from ansys.aedt.core.internal.filesystem import Scratch


Expand Down Expand Up @@ -100,16 +99,16 @@ def test_get_active_db(extension_under_test, test_folder, add_app):
app.close_project(app.project_name)


@pytest.mark.flaky_linux
@patch(
"ansys.aedt.core.extensions.hfss3dlayout.configure_layout.ConfigureLayoutExtension.selected_edb",
new_callable=PropertyMock,
)
def test_apply_config_to_edb(mock_selected_edb, test_folder, extension_under_test):
mock_selected_edb.return_value = test_folder.copy_si_verse()
config_path = test_folder.path / "config.json"
data = {"general": {"anti_pads_always_on": True, "suppress_pads": True}}
with open(config_path, "w", encoding="utf-8") as f:
json.dump(SERDES_CONFIG, f, ensure_ascii=False, indent=4)
json.dump(data, f, ensure_ascii=False, indent=4)
assert extension_under_test.apply_config_to_edb(config_path)


Expand Down
2 changes: 1 addition & 1 deletion tests/system/extensions/test_via_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from tests import TESTS_EXTENSIONS_PATH


@pytest.mark.skipif(is_linux, reason="Not supported in Linux.")
@pytest.mark.flaky_linux
def test_via_clustering_main_function(local_scratch):
"""Test the main function of the Via Clustering extension."""
# Copy test model to scratch directory
Expand Down
Loading