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)
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)
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)
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"))
def tearDown(self): if self.loaded: unload_ipython_extension(self.shell)
def test_003_test_deinitialize(self): self.loaded = False unload_ipython_extension(self.shell) self.assertNotIn('testificate', self.shell.user_ns)