示例#1
0
    def test_ip2(self):

        with patch('lantern.utils.get_ipython') as m:
            m.return_value = MagicMock()
            from lantern.utils import in_ipynb
            m.return_value.config = {'IPKernelApp': False}
            assert in_ipynb() == False
示例#2
0
    def test_ip3(self):

        with patch('lantern.utils.get_ipython') as m:
            m.return_value = MagicMock()
            m.return_value.config = {'IPKernelApp': True}

            from lantern.utils import in_ipynb
            assert in_ipynb() == True
示例#3
0
 def test_ip1(self):
     with patch('lantern.utils.get_ipython') as m:
         m.return_value = None
         from lantern.utils import in_ipynb
         assert in_ipynb() == False