Skip to content

Commit

Permalink
Testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Feb 13, 2018
1 parent 9846919 commit 5423e4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions spyder/widgets/projects/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ def delete_project(self):
# Tests
#==============================================================================
class ProjectExplorerTest(QWidget):

redirect_stdio = Signal(bool)

def __init__(self, directory=None):
QWidget.__init__(self)
vlayout = QVBoxLayout()
Expand Down
10 changes: 4 additions & 6 deletions spyder/widgets/projects/tests/test_project_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@pytest.fixture
def project_explorer(qtbot, request, tmpdir):
"""Setup Project Explorer widget."""
directory = request.node.get_marker('directory')
directory = request.node.get_marker('change_directory')
if directory:
project_dir = str(tmpdir.mkdir('project'))
else:
Expand All @@ -31,7 +31,7 @@ def project_explorer(qtbot, request, tmpdir):
return (project_explorer, project_dir)


@pytest.mark.directory
@pytest.mark.change_directory
def test_change_directory_in_project_explorer(project_explorer, qtbot):
"""Test changing a file from directory in the Project explorer."""
# Create project
Expand All @@ -46,15 +46,13 @@ def test_change_directory_in_project_explorer(project_explorer, qtbot):
open(project_file, 'w').close()

# Move Python file
project.treewidget.move(fnames=[osp.join(project_dir, 'script.py')],
project.explorer.treewidget.move(
fnames=[osp.join(project_dir, 'script.py')],
directory=project_dir_tmp)

# Assert content was moved
assert osp.isfile(osp.join(project_dir_tmp, 'script.py'))

# Close project
project.close_project()


def test_project_explorer(project_explorer, qtbot):
"""Run project explorer."""
Expand Down

0 comments on commit 5423e4b

Please sign in to comment.