Esempio n. 1
0
    def test_with_it(self):
        app, it = GUI().with_it()

        with pytest.raises(ValueError):
            it()

        with app.root() as root:
            assert it() is root
            with app.button() as button:
                assert it() is button
Esempio n. 2
0
    def test_it(self, app: GUI):
        with pytest.raises(ValueError):
            app.it()

        with app.root() as root:
            assert app.it() is root
            with app.button() as button:
                assert app.it() is button
Esempio n. 3
0
 def test_treeview(self, app: GUI):
     with app.root():
         with app.treeview() as w:
             assert isinstance(w, tw.Treeview)
Esempio n. 4
0
 def test_scale(self, app: GUI):
     with app.root():
         with app.scale() as w:
             assert isinstance(w, tw.Scale)
Esempio n. 5
0
 def test_listbox(self, app: GUI):
     with app.root():
         with app.listbox() as w:
             assert isinstance(w, tw.Listbox)
Esempio n. 6
0
 def test_message(self, app: GUI):
     with app.root():
         with app.message() as w:
             assert isinstance(w, tw.Message)
Esempio n. 7
0
 def test_entry(self, app: GUI):
     with app.root():
         with app.entry() as w:
             assert isinstance(w, tw.Entry)
Esempio n. 8
0
 def test_label_frame(self, app: GUI):
     with app.root():
         with app.label_frame() as w:
             assert isinstance(w, tw.LabelFrame)
Esempio n. 9
0
 def test_button(self, app: GUI):
     with app.root():
         with app.button() as w:
             assert isinstance(w, tw.Button)
Esempio n. 10
0
 def test_checkbutton(self, app: GUI):
     with app.root():
         with app.checkbutton() as w:
             assert isinstance(w, tw.Checkbutton)
Esempio n. 11
0
 def test_root(self, app: GUI):
     with app.root():
         with app.root() as w:
             assert isinstance(w, tk.Tk)
Esempio n. 12
0
 def test_run(self, app: GUI):
     mocked_root = mock.MagicMock()
     app._root = mocked_root
     app.run()
     mocked_root.mainloop.assert_called_once_with()
Esempio n. 13
0
 def test_radiobutton(self, app: GUI):
     with app.root():
         with app.radiobutton() as w:
             assert isinstance(w, tw.Radiobutton)
Esempio n. 14
0
 def test_progressbar(self, app: GUI):
     with app.root():
         with app.progressbar() as w:
             assert isinstance(w, tw.Progressbar)
Esempio n. 15
0
 def test_paned_window(self, app: GUI):
     with app.root():
         with app.paned_window() as w:
             assert isinstance(w, tw.PanedWindow)
Esempio n. 16
0
 def test_option_menu(self, app: GUI):
     with app.root():
         with app.option_menu(tk.StringVar()) as w:
             assert isinstance(w, tw.OptionMenu)
Esempio n. 17
0
 def test_notebook(self, app: GUI):
     with app.root():
         with app.notebook() as w:
             assert isinstance(w, tw.Notebook)
Esempio n. 18
0
 def test_widget(self, app: GUI):
     with app.root():
         with app.widget(tk.Button) as button:
             assert isinstance(button, tk.Button)
Esempio n. 19
0
 def test_scrollbar(self, app: GUI):
     with app.root():
         with app.scrollbar() as w:
             assert isinstance(w, tw.Scrollbar)
Esempio n. 20
0
 def test_canvas(self, app: GUI):
     with app.root():
         with app.canvas() as w:
             assert isinstance(w, tw.Canvas)
Esempio n. 21
0
 def test_separator(self, app: GUI):
     with app.root():
         with app.separator() as w:
             assert isinstance(w, tw.Separator)
Esempio n. 22
0
 def test_combobox(self, app: GUI):
     with app.root():
         with app.combobox() as w:
             assert isinstance(w, tw.Combobox)
Esempio n. 23
0
 def test_sizegrip(self, app: GUI):
     with app.root():
         with app.sizegrip() as w:
             assert isinstance(w, tw.Sizegrip)
Esempio n. 24
0
 def test_frame(self, app: GUI):
     with app.root():
         with app.frame() as w:
             assert isinstance(w, tw.Frame)
Esempio n. 25
0
 def test_spinbox(self, app: GUI):
     with app.root():
         with app.spinbox() as w:
             assert isinstance(w, tw.Spinbox)
Esempio n. 26
0
 def test_labeled_scale(self, app: GUI):
     with app.root():
         with app.labeled_scale() as w:
             assert isinstance(w, tw.LabeledScale)
Esempio n. 27
0
 def test_text(self, app: GUI):
     with app.root():
         with app.text() as w:
             assert isinstance(w, tw.Text)
Esempio n. 28
0
 def test_menu(self, app: GUI):
     with app.root():
         with app.menu() as w:
             assert isinstance(w, tw.Menu)
Esempio n. 29
0
def app() -> GUI:
    return GUI()