This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from steff456/graphical-plugin
PR: Add option to select between SpyderPlugin and SpyderPluginWidget
- Loading branch information
Showing
7 changed files
with
129 additions
and
28 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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# Testing | ||
pytest | ||
pytest-cookies |
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 |
---|---|---|
|
@@ -17,6 +17,21 @@ def context(): | |
} | ||
|
||
|
||
@pytest.fixture | ||
def non_graphical(): | ||
return { | ||
'author': 'Spyder Project Contributors', | ||
'email': '[email protected]', | ||
'github_username': 'spyder-ide', | ||
'plugin_name': 'Demo-nongraphic', | ||
'repo_name': 'spyder-demo-nongraphic', | ||
'project_name': 'spyder_demo_nongraphic', | ||
'description': 'Plugin for Spyder IDE.', | ||
'version': '0.1.0', | ||
'graphical_plugin': 'n' | ||
} | ||
|
||
|
||
def test_default_configuration(cookies, context): | ||
result = cookies.bake(extra_context=context) | ||
assert result.exit_code == 0 | ||
|
@@ -44,3 +59,33 @@ def test_default_configuration(cookies, context): | |
|
||
for path in project_files: | ||
assert path in found_project_files | ||
|
||
|
||
def test_non_graphical_configuration(cookies, non_graphical): | ||
"""Test generation of non-graphical plugin.""" | ||
result = cookies.bake(extra_context=non_graphical) | ||
assert result.exit_code == 0 | ||
assert result.exception is None | ||
assert result.project.basename == non_graphical['repo_name'] | ||
assert result.project.isdir() | ||
|
||
# Test creation of project files | ||
|
||
toplevel_files = ['MANIFEST.in', 'README.rst', 'setup.py', | ||
'requirements.txt', '.gitattributes'] | ||
|
||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
|
||
for path in toplevel_files: | ||
assert path in found_toplevel_files | ||
|
||
# Test creation of plugin files | ||
|
||
project_files = ['assets', 'demo-nongraphicplugin.py', '_version.py', | ||
'__init__.py', 'tests'] | ||
|
||
project_dir = result.project.join(non_graphical['project_name']) | ||
found_project_files = [f.basename for f in project_dir.listdir()] | ||
|
||
for path in project_files: | ||
assert path in found_project_files |
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