From 76a328dabc26b8b65d22edee1d6c0ccf8c227687 2015-04-04 22:06:30 From: Min RK Date: 2015-04-04 22:06:30 Subject: [PATCH] use traitlets.tests.utils for help output tests for non-IPython projects --- diff --git a/IPython/html/tests/test_notebookapp.py b/IPython/html/tests/test_notebookapp.py index 088a647..8546589 100644 --- a/IPython/html/tests/test_notebookapp.py +++ b/IPython/html/tests/test_notebookapp.py @@ -1,15 +1,5 @@ """Test NotebookApp""" -#----------------------------------------------------------------------------- -# Copyright (C) 2013 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- import logging import os @@ -17,19 +7,17 @@ from tempfile import NamedTemporaryFile import nose.tools as nt +from traitlets.tests.utils import check_help_all_output + from IPython.utils.tempdir import TemporaryDirectory from IPython.utils.traitlets import TraitError -import IPython.testing.tools as tt from IPython.html import notebookapp NotebookApp = notebookapp.NotebookApp -#----------------------------------------------------------------------------- -# Test functions -#----------------------------------------------------------------------------- def test_help_output(): """ipython notebook --help-all works""" - tt.help_all_output_test('notebook') + check_help_all_output('IPython.html') def test_server_info_file(): nbapp = NotebookApp(profile='nbserver_file_test', log=logging.getLogger()) diff --git a/IPython/html/tests/test_utils.py b/IPython/html/tests/test_utils.py index 0eb6166..eba3f75 100644 --- a/IPython/html/tests/test_utils.py +++ b/IPython/html/tests/test_utils.py @@ -1,31 +1,21 @@ """Test HTML utils""" -#----------------------------------------------------------------------------- -# Copyright (C) 2013 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. import os import nose.tools as nt -import IPython.testing.tools as tt +from traitlets.tests.utils import check_help_all_output from IPython.html.utils import url_escape, url_unescape, is_hidden from IPython.utils.tempdir import TemporaryDirectory -#----------------------------------------------------------------------------- -# Test functions -#----------------------------------------------------------------------------- def test_help_output(): - """ipython notebook --help-all works""" - tt.help_all_output_test('notebook') + """jupyter notebook --help-all works""" + # FIXME: will be jupyter_notebook + check_help_all_output('IPython.html') def test_url_escape(): diff --git a/jupyter_console/tests/test_console.py b/jupyter_console/tests/test_console.py index d406039..e7bc884 100644 --- a/jupyter_console/tests/test_console.py +++ b/jupyter_console/tests/test_console.py @@ -1,28 +1,15 @@ -"""Tests for two-process terminal frontend +"""Tests for two-process terminal frontend""" -Currently only has the most simple test possible, starting a console and running -a single command. - -Authors: - -* Min RK -""" - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. import sys from nose import SkipTest -import IPython.testing.tools as tt +from traitlets.tests.utils import check_help_all_output from IPython.testing import decorators as dec -#----------------------------------------------------------------------------- -# Tests -#----------------------------------------------------------------------------- - @dec.skip_win32 def test_console_starts(): """test that `ipython console` starts a terminal""" @@ -34,8 +21,7 @@ def test_console_starts(): def test_help_output(): """ipython console --help-all works""" - tt.help_all_output_test('console') - + check_help_all_output('jupyter_console') def test_display_text(): "Ensure display protocol plain/text key is supported" diff --git a/jupyter_nbconvert/tests/test_nbconvertapp.py b/jupyter_nbconvert/tests/test_nbconvertapp.py index 61b1ad0..2b4e65e 100644 --- a/jupyter_nbconvert/tests/test_nbconvertapp.py +++ b/jupyter_nbconvert/tests/test_nbconvertapp.py @@ -11,7 +11,7 @@ import sys from .base import TestsBase from ..postprocessors import PostProcessorBase -import IPython.testing.tools as tt +from traitlets.tests.utils import check_help_all_output from IPython.testing import decorators as dec #----------------------------------------------------------------------------- @@ -34,7 +34,7 @@ class TestNbConvertApp(TestsBase): def test_help_output(self): """ipython nbconvert --help-all works""" - tt.help_all_output_test('nbconvert') + check_help_all_output('jupyter_nbconvert') def test_glob(self): """ diff --git a/jupyter_qtconsole/console/tests/test_app.py b/jupyter_qtconsole/console/tests/test_app.py index 9c7c2b3..2168f6b 100644 --- a/jupyter_qtconsole/console/tests/test_app.py +++ b/jupyter_qtconsole/console/tests/test_app.py @@ -1,27 +1,15 @@ """Test QtConsoleApp""" -#----------------------------------------------------------------------------- -# Copyright (C) 2013 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. import nose.tools as nt -import IPython.testing.tools as tt +from traitlets.tests.utils import check_help_all_output from IPython.testing.decorators import skip_if_no_x11 -#----------------------------------------------------------------------------- -# Test functions -#----------------------------------------------------------------------------- - @skip_if_no_x11 def test_help_output(): - """ipython qtconsole --help-all works""" - tt.help_all_output_test('qtconsole') + """jupyter qtconsole --help-all works""" + check_help_all_output('jupyter_qtconsole')