##// END OF EJS Templates
Cleaning up JS tests controller.
Cleaning up JS tests controller.

File last commit:

r14177:08e7c9f3
r15090:f305571f
Show More
test_notebookapp.py
40 lines | 1.5 KiB | text/x-python | PythonLexer
/ IPython / html / tests / test_notebookapp.py
MinRK
test that `-h` and `--help-all` work for various IPython entry points...
r12354 """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 nose.tools as nt
import IPython.testing.tools as tt
Thomas Kluyver
Test for writing and removing server info files
r14064 from IPython.html import notebookapp
MinRK
test that `-h` and `--help-all` work for various IPython entry points...
r12354
#-----------------------------------------------------------------------------
# Test functions
#-----------------------------------------------------------------------------
def test_help_output():
"""ipython notebook --help-all works"""
tt.help_all_output_test('notebook')
Thomas Kluyver
Test for writing and removing server info files
r14064 def test_server_info_file():
nbapp = notebookapp.NotebookApp(profile='nbserver_file_test')
def get_servers():
Thomas Kluyver
Command line entry point to list running notebook servers
r14177 return list(notebookapp.list_running_servers(profile='nbserver_file_test'))
Thomas Kluyver
Test for writing and removing server info files
r14064 nbapp.initialize(argv=[])
nbapp.write_server_info_file()
servers = get_servers()
nt.assert_equal(len(servers), 1)
nt.assert_equal(servers[0]['port'], nbapp.port)
nt.assert_equal(servers[0]['url'], nbapp.connection_url)
nbapp.remove_server_info_file()
nt.assert_equal(get_servers(), [])
# The ENOENT error should be silenced.
nbapp.remove_server_info_file()