-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
11 changed files
with
222 additions
and
51 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Tests for configdialog.py | ||
""" | ||
|
||
# Standard librery imports | ||
import os.path as osp | ||
import tempfile | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.widgets.projects.configdialog import (EmptyProject, | ||
ProjectPreferences) | ||
|
||
@pytest.fixture | ||
def setup_projects_preferences(qtbot): | ||
"""Set up ProjectPreferences.""" | ||
project_dir = tempfile.mkdtemp() + osp.sep + '.spyproject' | ||
project = EmptyProject(project_dir) | ||
project_preferences = ProjectPreferences(None, project) | ||
qtbot.addWidget(project_preferences) | ||
return (project, project_preferences) | ||
|
||
def test_projects_preferences(qtbot): | ||
"""Run Project Preferences.""" | ||
project, preferences = setup_projects_preferences(qtbot) | ||
preferences.resize(250, 480) | ||
preferences.show() | ||
assert preferences | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Tests for explorer.py | ||
""" | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.widgets.projects.explorer import ProjectExplorerTest | ||
|
||
@pytest.fixture | ||
def setup_projects_explorer(qtbot): | ||
"""Set up ProjectExplorerWidgetTest.""" | ||
project_explorer = ProjectExplorerTest() | ||
qtbot.addWidget(project_explorer) | ||
return project_explorer | ||
|
||
def test_project_explorer(qtbot): | ||
"""Run project explorer.""" | ||
project_explorer = setup_projects_explorer(qtbot) | ||
project_explorer.resize(250, 480) | ||
project_explorer.show() | ||
assert project_explorer | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Tests for projectdialog.py | ||
""" | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.widgets.projects.projectdialog import ProjectDialog | ||
|
||
@pytest.fixture | ||
def setup_projects_dialog(qtbot): | ||
"""Set up ProjectDialog.""" | ||
dlg = ProjectDialog(None) | ||
qtbot.addWidget(dlg) | ||
return dlg | ||
|
||
def test_project_dialog(qtbot): | ||
"""Run project dialog.""" | ||
dlg = setup_projects_dialog(qtbot) | ||
dlg.show() | ||
assert dlg | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |
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
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
33 changes: 33 additions & 0 deletions
33
spyder/widgets/variableexplorer/tests/test_importwizard.py
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Tests for importwizard.py | ||
""" | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.widgets.variableexplorer.importwizard import ImportWizard | ||
|
||
@pytest.fixture | ||
def setup_importwizard(qtbot, text): | ||
"""Set up ImportWizard.""" | ||
importwizard = ImportWizard(None, text) | ||
qtbot.addWidget(importwizard) | ||
return importwizard | ||
|
||
def test_importwizard(qtbot): | ||
"""Run ImportWizard dialog.""" | ||
text = u"17/11/1976\t1.34\n14/05/09\t3.14" | ||
importwizard = setup_importwizard(qtbot, text) | ||
importwizard.show() | ||
assert importwizard | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Tests for texteditor.py | ||
""" | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.widgets.variableexplorer.texteditor import TextEditor | ||
|
||
@pytest.fixture | ||
def setup_texteditor(qtbot, text): | ||
"""Set up TextEditor.""" | ||
texteditor = TextEditor(text) | ||
qtbot.addWidget(texteditor) | ||
return texteditor | ||
|
||
def test_texteditor(qtbot): | ||
"""Run TextEditor dialog.""" | ||
text = """01234567890123456789012345678901234567890123456789012345678901234567890123456789 | ||
dedekdh elkd ezd ekjd lekdj elkdfjelfjk e""" | ||
texteditor = setup_texteditor(qtbot, text) | ||
texteditor.show() | ||
assert texteditor | ||
dlg_text = texteditor.get_value() | ||
assert text == dlg_text | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |