Beispiel #1
0
 def test_qgrid(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     df = pandas.DataFrame([{"x": 2, "y": 3}, {"x": 4, "y": 5}])
     mg = MagicNotebook()
     mg.add_context({"df": df})
     try:
         res = mg.jsdf("df --editable=False")
         fLOG(res)
     except traitlets.traitlets.TraitError:
         # qgrid needs a true notebook as the grid is editable
         pass
     except AttributeError as e:
         if "'NoneType' object has no attribute 'session'" not in str(e):
             raise e
     try:
         res = mg.jsdf("df --editable=False")
         fLOG(res)
         assert res is not None
     except traitlets.traitlets.TraitError:
         # qgrid needs a true notebook as the grid is editable
         pass
     except AttributeError as e:
         if "'NoneType' object has no attribute 'session'" not in str(e):
             raise e
Beispiel #2
0
 def test_head(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     mg = MagicNotebook()
     res = mg.nb_menu("")
     fLOG(res)
     assert res is not None
Beispiel #3
0
 def test_head(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     mg = MagicNotebook()
     res = mg.nb_menu("")
     fLOG(res)
     assert res is not None
Beispiel #4
0
 def test_qgrid(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     df = pandas.DataFrame([{"x": 2, "y": 3}, {"x": 4, "y": 5}])
     mg = MagicNotebook()
     mg.add_context({"df": df})
     try:
         res = mg.jsdf("df --editable=False")
         fLOG(res)
     except traitlets.traitlets.TraitError:
         # qgrid needs a true notebook as the grid is editable
         pass
     except AttributeError as e:
         if "'NoneType' object has no attribute 'session'" not in str(e):
             raise e
     try:
         res = mg.jsdf("df --editable=False")
         fLOG(res)
         assert res is not None
     except traitlets.traitlets.TraitError:
         # qgrid needs a true notebook as the grid is editable
         pass
     except AttributeError as e:
         if "'NoneType' object has no attribute 'session'" not in str(e):
             raise e