diff --git a/tests/app/execute_test.py b/tests/app/execute_test.py index bf34b0234..3aecb2c6d 100644 --- a/tests/app/execute_test.py +++ b/tests/app/execute_test.py @@ -19,7 +19,7 @@ def test_hello_world(http_client, base_url): assert response.code == 200 html_text = response.body.decode('utf-8') assert 'Hi Voila' in html_text - assert 'print' not in html_text, 'by default the source code should be stripped' + assert 'print(' not in html_text, 'by default the source code should be stripped' assert 'test_template.css' not in html_text, "test_template should not be the default" diff --git a/tests/server/execute_test.py b/tests/server/execute_test.py index 801c35e6c..692151a1f 100644 --- a/tests/server/execute_test.py +++ b/tests/server/execute_test.py @@ -8,5 +8,5 @@ def test_hello_world(http_client, print_notebook_url): assert response.code == 200 html_text = response.body.decode('utf-8') assert 'Hi Voila' in html_text - assert 'print' not in html_text, 'by default the source code should be stripped' + assert 'print(' not in html_text, 'by default the source code should be stripped' assert 'test_template.css' not in html_text, "test_template should not be the default" diff --git a/voila/handler.py b/voila/handler.py index 30e58f4a9..ecf50f3e3 100644 --- a/voila/handler.py +++ b/voila/handler.py @@ -59,11 +59,17 @@ async def get(self, path=None): return self.cwd = os.path.dirname(notebook_path) + path, basename = os.path.split(notebook_path) + notebook_name = os.path.splitext(basename)[0] + # render notebook to html resources = { 'base_url': self.base_url, 'nbextensions': nbextensions, - 'theme': self.voila_configuration.theme + 'theme': self.voila_configuration.theme, + 'metadata': { + 'name': notebook_name + } } # include potential extra resources