Skip to content

Commit

Permalink
SQ -> New projects are created with contained .crystalopen. Can open …
Browse files Browse the repository at this point in the history
….crystalopen file.
  • Loading branch information
davidfstr committed Sep 28, 2023
1 parent 6bc6f7c commit 1d39b6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/crystal/tests/util/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ def click_checkbox(checkbox: wx.CheckBox) -> None:
# ------------------------------------------------------------------------------
# Utility: Controls: wx.FileDialog, wx.DirDialog

@contextmanager
def package_dialog_returning(filepath: str) -> Iterator[None]:
if project_appears_as_package_file():
with file_dialog_returning(filepath):
yield
else:
with dir_dialog_returning(filepath):
yield


@contextmanager
def file_dialog_returning(filepath: str) -> Iterator[None]:
with unittest.mock.patch('wx.FileDialog', spec=True) as MockFileDialog:
Expand Down
6 changes: 3 additions & 3 deletions src/crystal/tests/util/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from crystal.model import Project
from crystal.tests.util.controls import (
click_button, file_dialog_returning, package_dialog_returning,
click_button, file_dialog_returning,
TreeItem
)
from crystal.tests.util.runner import bg_sleep, pump_wx_events
Expand Down Expand Up @@ -108,7 +108,7 @@ async def open(self,
if readonly is not None:
self.open_as_readonly.Value = readonly

with package_dialog_returning(project_dirpath):
with file_dialog_returning(project_dirpath):
click_button(self.open_button)

with screenshot_if_raises():
Expand All @@ -125,7 +125,7 @@ async def open(self,
await mw.close(exc_info_while_close)

async def start_opening(self, project_dirpath: str, *, next_window_name: str) -> None:
with package_dialog_returning(project_dirpath):
with file_dialog_returning(project_dirpath):
click_button(self.open_button)

await wait_for(
Expand Down

0 comments on commit 1d39b6a

Please sign in to comment.