Show More
@@ -14,6 +14,7 | |||||
14 | import nose.tools as nt |
|
14 | import nose.tools as nt | |
15 |
|
15 | |||
16 | import IPython.testing.tools as tt |
|
16 | import IPython.testing.tools as tt | |
|
17 | from IPython.html import notebookapp | |||
17 |
|
18 | |||
18 | #----------------------------------------------------------------------------- |
|
19 | #----------------------------------------------------------------------------- | |
19 | # Test functions |
|
20 | # Test functions | |
@@ -23,3 +24,18 def test_help_output(): | |||||
23 | """ipython notebook --help-all works""" |
|
24 | """ipython notebook --help-all works""" | |
24 | tt.help_all_output_test('notebook') |
|
25 | tt.help_all_output_test('notebook') | |
25 |
|
26 | |||
|
27 | def test_server_info_file(): | |||
|
28 | nbapp = notebookapp.NotebookApp(profile='nbserver_file_test') | |||
|
29 | def get_servers(): | |||
|
30 | return list(notebookapp.discover_running_servers(profile='nbserver_file_test')) | |||
|
31 | nbapp.initialize(argv=[]) | |||
|
32 | nbapp.write_server_info_file() | |||
|
33 | servers = get_servers() | |||
|
34 | nt.assert_equal(len(servers), 1) | |||
|
35 | nt.assert_equal(servers[0]['port'], nbapp.port) | |||
|
36 | nt.assert_equal(servers[0]['url'], nbapp.connection_url) | |||
|
37 | nbapp.remove_server_info_file() | |||
|
38 | nt.assert_equal(get_servers(), []) | |||
|
39 | ||||
|
40 | # The ENOENT error should be silenced. | |||
|
41 | nbapp.remove_server_info_file() No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now