def test_has_ipynb_shell_true(mock_get_ipython): mock_get_ipython().__class__.__name__ = 'ZMQInteractiveShell' assert has_ipynb_shell() == True
def test_has_ipynb_shell_terminal(mock_get_ipython): mock_get_ipython().__class__.__name__ = 'TerminalInteractiveShell' assert has_ipynb_shell() == False
def test_has_ipynb_shell_except_return_false(mock_get_ipython, mock_import): assert has_ipynb_shell() == False
def test_has_ipynb_shell(mock_get_ipython, get_ipython, expected_result): mock_get_ipython().__class__.__name__ = get_ipython assert has_ipynb_shell() == expected_result