-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,46 @@ | ||
import pytest | ||
from PyQt6 import QtCore | ||
|
||
from rascal2.dialogs.startup_dialog import ProjectDialog, StartUpDialog | ||
from rascal2.ui.view import MainWindowView | ||
|
||
|
||
class TestStartUpDialog: | ||
@pytest.fixture(autouse=True) | ||
def setUp(self): | ||
self.view = MainWindowView() | ||
self.startup_dialog = StartUpDialog(self.view) | ||
def test_startup_dialog_initial_state(): | ||
""" | ||
Tests the initial state of the start up dialog. | ||
""" | ||
startup_dialog = StartUpDialog() | ||
|
||
def test_initial_state(self): | ||
assert self.startup_dialog.windowFlags() == ( | ||
QtCore.Qt.WindowType.FramelessWindowHint | QtCore.Qt.WindowType.Dialog | ||
) | ||
assert self.startup_dialog.isModal() | ||
assert startup_dialog.windowFlags() == (QtCore.Qt.WindowType.FramelessWindowHint | QtCore.Qt.WindowType.Dialog) | ||
assert startup_dialog.isModal() | ||
|
||
assert self.startup_dialog._new_project_button.isEnabled() | ||
assert self.startup_dialog._import_project_button.isEnabled() | ||
assert self.startup_dialog._load_example_button.isEnabled() | ||
assert startup_dialog._new_project_button.isEnabled() | ||
assert startup_dialog._import_project_button.isEnabled() | ||
assert startup_dialog._load_example_button.isEnabled() | ||
|
||
assert self.startup_dialog._new_project_label.text() == "New\nProject" | ||
assert self.startup_dialog._import_project_label.text() == "Import Existing\nProject" | ||
assert self.startup_dialog._load_example_label.text() == "Open Example\nProject" | ||
assert startup_dialog._new_project_label.text() == "New\nProject" | ||
assert startup_dialog._import_project_label.text() == "Import Existing\nProject" | ||
assert startup_dialog._load_example_label.text() == "Open Example\nProject" | ||
|
||
|
||
class TestProjectDialog: | ||
@pytest.fixture(autouse=True) | ||
def setUp(self): | ||
self.view = MainWindowView() | ||
self.project_dialog = ProjectDialog(self.view) | ||
def test_project_dialog_initial_state(): | ||
""" | ||
Tests the inital state of the project dialog. | ||
""" | ||
project_dialog = ProjectDialog() | ||
|
||
def test_initial_state(self): | ||
assert self.project_dialog._create_button.isEnabled() | ||
assert self.project_dialog._cancel_button.isEnabled() | ||
assert self.project_dialog._browse_button.isEnabled() | ||
assert project_dialog.isModal() | ||
|
||
assert self.project_dialog._create_button.text() == " Create" | ||
assert self.project_dialog._cancel_button.text() == " Cancel" | ||
assert self.project_dialog._browse_button.text() == " Browse" | ||
assert project_dialog._create_button.isEnabled() | ||
assert project_dialog._cancel_button.isEnabled() | ||
assert project_dialog._browse_button.isEnabled() | ||
|
||
assert self.project_dialog._project_name_label.text() == "Project Name:" | ||
assert self.project_dialog._project_folder_label.text() == "Project Folder:" | ||
assert self.project_dialog._project_folder.text() == "No folder selected" | ||
assert project_dialog._create_button.text() == " Create" | ||
assert project_dialog._cancel_button.text() == " Cancel" | ||
assert project_dialog._browse_button.text() == " Browse" | ||
|
||
assert self.project_dialog._project_name.text() == "" | ||
assert self.project_dialog._project_name.placeholderText() == "Enter project name" | ||
assert project_dialog._project_name_label.text() == "Project Name:" | ||
assert project_dialog._project_folder_label.text() == "Project Folder:" | ||
assert project_dialog._project_folder.text() == "No folder selected" | ||
|
||
assert project_dialog._project_name.text() == "" | ||
assert project_dialog._project_name.placeholderText() == "Enter project name" | ||
assert not project_dialog._folder_selected |