Skip to content

Commit

Permalink
update tests with new property
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinknair committed Jan 6, 2025
1 parent 74a27e3 commit f3a7c63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ansys/mechanical/core/embedding/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def save_temp_copy(
A Mechanical embedding application.
"""
# Identify the mechdb of the saved session from save_original()
project_directory = Path(app.DataModel.Project.ProjectDirectory)
project_directory = Path(app.project_directory)
project_directory_parent = project_directory.parent
mechdb_file = (
project_directory_parent / f"{project_directory.parts[-1].split('_')[0]}.mechdb"
Expand Down
4 changes: 2 additions & 2 deletions tests/embedding/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def test_rm_lockfile(embedded_app, tmp_path: pytest.TempPathFactory):
embedded_app.save(mechdat_path)
embedded_app.close()

lockfile_path = os.path.join(embedded_app.DataModel.Project.ProjectDirectory, ".mech_lock")
lockfile_path = os.path.join(embedded_app.project_directory, ".mech_lock")
# Assert lock file path does not exist
assert not os.path.exists(lockfile_path)

Expand Down Expand Up @@ -450,7 +450,7 @@ def test_app_lock_file_open(embedded_app, tmp_path: pytest.TempPathFactory):
embedded_app.save_as(project_file)
embedded_app.save_as(project_file, overwrite=True)

lock_file = Path(embedded_app.DataModel.Project.ProjectDirectory) / ".mech_lock"
lock_file = Path(embedded_app.project_directory) / ".mech_lock"

# Assert the lock file exists after saving it
assert lock_file.exists()
Expand Down

0 comments on commit f3a7c63

Please sign in to comment.