コード例 #1
0
    def test_003_formatter_unload_success(self):
        self.loaded = False
        unload_ipython_extension(self.shell)

        with self.assertRaises(KeyError):
            self.shell.display_formatter.mimebundle_formatter.lookup(
                STATIC_OBJECT)
コード例 #2
0
    def test_004_feature_deinitialization(self):
        load_ipython_extension(self.shell)
        yuuno = Yuuno.instance()
        unload_ipython_extension(self.shell)

        self.assertTrue(yuuno.environment.features[0].init_called)
        self.assertTrue(yuuno.environment.features[0].deinit_called)
コード例 #3
0
    def test_002_ipython_disable(self):
        load_ipython_extension(self.shell)
        yuuno = Yuuno.instance()
        ext = yuuno.extensions[0]
        unload_ipython_extension(self.shell)

        self.assertIsNot(yuuno, Yuuno.instance())
        self.assertNotIn(yuuno, self.shell.configurables)
        self.assertNotIn(yuuno.environment, self.shell.configurables)
        self.assertNotIn(ext, self.shell.configurables)
コード例 #4
0
 def test_003_test_magic_autounregister(self):
     self.loaded = False
     unload_ipython_extension(self.shell)
     self.assertIsNone(self._run_magic("line", "test_line_magic", "testificate"))
     self.assertIsNone(self._run_magic("cell", "test_cell_magic", "testificate", "1 2 3"))
コード例 #5
0
 def tearDown(self):
     if self.loaded:
         unload_ipython_extension(self.shell)
コード例 #6
0
 def test_003_test_deinitialize(self):
     self.loaded = False
     unload_ipython_extension(self.shell)
     self.assertNotIn('testificate', self.shell.user_ns)