def test_inject(self):
        nb = Notebook(support_file('notebook.ipynb'))
        self.assertTrue(nb.inject('user/environment'))

        with open(support_file('notebook.ipynb'), 'w') as fb:
            fb.write(json.dumps(notebook))
 def test_notebook_not_exist(self):
     nb = Notebook('no-exist.ipynb')
     self.assertEqual(nb.inject('content'), False)
     self.assertEqual(nb.msg, "no-exist.ipynb may not exist or you don't have adecuate permissions")
 def test_environment_already_exist(self):
     nb = Notebook(support_file('notebook-with-env.ipynb'))
     self.assertEqual(nb.inject('content'), False)
Exemple #4
0
    def test_inject(self):
        nb = Notebook(support_file('notebook.ipynb'))
        self.assertTrue(nb.inject('user/environment'))

        with open(support_file('notebook.ipynb'), 'w') as fb:
            fb.write(json.dumps(notebook, sort_keys=True))
Exemple #5
0
    def test_inject_env(self):
        nb = Notebook(support_file('notebook.ipynb'))
        self.assertTrue(nb.inject('content'))

        with open(support_file('notebook.ipynb'), 'w') as fb:
            fb.write(json.dumps(notebook, sort_keys=True))
Exemple #6
0
 def test_environment_already_exist(self):
     nb = Notebook(support_file('notebook-with-env.ipynb'))
     self.assertEqual(nb.inject('content'), False)
Exemple #7
0
 def test_notebook_not_exist(self):
     nb = Notebook('no-exist.ipynb')
     self.assertEqual(nb.inject('content'), False)
     self.assertEqual(nb.msg, "no-exist.ipynb may not exist or you don't have adequate permissions")
    def test_inject_env(self):
        nb = Notebook(support_file('notebook.ipynb'))
        self.assertTrue(nb.inject('content'))

        with open(support_file('notebook.ipynb'), 'w') as fb:
            fb.write(json.dumps(notebook))