示例#1
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))
示例#2
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 adecuate permissions")
示例#3
0
 def test_environment_already_exist(self):
     nb = Notebook(support_file('notebook-with-env.ipynb'))
     self.assertEqual(nb.inject('content'), False)
示例#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))
示例#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))
示例#6
0
 def test_environment_already_exist(self):
     nb = Notebook(support_file('notebook-with-env.ipynb'))
     self.assertEqual(nb.inject('content'), False)
示例#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")
示例#8
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))