def test_init(self): app = App() self.assertIs(app.app, app) self.assertTrue(isinstance(app.widget, tk.Tk)) self.assertIs(app.widget.element, app) self.assertEqual(app.getChildren(), []) self.assertFalse(app.isShown()) app.show(mainloop=False) self.assertTrue(app.isShown()) app.hide() self.assertFalse(app.isShown()) app.remove() self.assertEqual(False, app.isShown(error=False))
def test_apps(self): self.assertEqual([], App.getApps()) app = App() self.assertEqual([app], app.getApps()) app2 = App() self.assertEqual([app, app2], app.getApps()) self.assertEqual([app, app2], App.getApps()) app.remove() self.assertEqual([app2], App.getApps()) app2.remove() self.assertEqual([], App.getApps())
def test_states(self): app = App() self.assertEqual(False, app.isShown()) self.assertEqual(True, app.exists()) self.assertEqual(True, app.isPacked()) app.show(mainloop=False) self.assertEqual(True, app.isShown()) self.assertEqual(True, app.exists()) self.assertEqual(True, app.isPacked()) app.hide() self.assertEqual(False, app.isShown()) self.assertEqual(True, app.exists()) self.assertEqual(True, app.isPacked()) app.remove() self.assertEqual(False, app.isShown()) self.assertEqual(False, app.exists()) self.assertEqual(False, app.isPacked())