Пример #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
Пример #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
Пример #3
0
 def test_treeview(self, app: GUI):
     with app.root():
         with app.treeview() as w:
             assert isinstance(w, tw.Treeview)
Пример #4
0
 def test_scale(self, app: GUI):
     with app.root():
         with app.scale() as w:
             assert isinstance(w, tw.Scale)
Пример #5
0
 def test_listbox(self, app: GUI):
     with app.root():
         with app.listbox() as w:
             assert isinstance(w, tw.Listbox)
Пример #6
0
 def test_message(self, app: GUI):
     with app.root():
         with app.message() as w:
             assert isinstance(w, tw.Message)
Пример #7
0
 def test_entry(self, app: GUI):
     with app.root():
         with app.entry() as w:
             assert isinstance(w, tw.Entry)
Пример #8
0
 def test_label_frame(self, app: GUI):
     with app.root():
         with app.label_frame() as w:
             assert isinstance(w, tw.LabelFrame)
Пример #9
0
 def test_button(self, app: GUI):
     with app.root():
         with app.button() as w:
             assert isinstance(w, tw.Button)
Пример #10
0
 def test_checkbutton(self, app: GUI):
     with app.root():
         with app.checkbutton() as w:
             assert isinstance(w, tw.Checkbutton)
Пример #11
0
 def test_root(self, app: GUI):
     with app.root():
         with app.root() as w:
             assert isinstance(w, tk.Tk)
Пример #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()
Пример #13
0
 def test_radiobutton(self, app: GUI):
     with app.root():
         with app.radiobutton() as w:
             assert isinstance(w, tw.Radiobutton)
Пример #14
0
 def test_progressbar(self, app: GUI):
     with app.root():
         with app.progressbar() as w:
             assert isinstance(w, tw.Progressbar)
Пример #15
0
 def test_paned_window(self, app: GUI):
     with app.root():
         with app.paned_window() as w:
             assert isinstance(w, tw.PanedWindow)
Пример #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)
Пример #17
0
 def test_notebook(self, app: GUI):
     with app.root():
         with app.notebook() as w:
             assert isinstance(w, tw.Notebook)
Пример #18
0
 def test_widget(self, app: GUI):
     with app.root():
         with app.widget(tk.Button) as button:
             assert isinstance(button, tk.Button)
Пример #19
0
 def test_scrollbar(self, app: GUI):
     with app.root():
         with app.scrollbar() as w:
             assert isinstance(w, tw.Scrollbar)
Пример #20
0
 def test_canvas(self, app: GUI):
     with app.root():
         with app.canvas() as w:
             assert isinstance(w, tw.Canvas)
Пример #21
0
 def test_separator(self, app: GUI):
     with app.root():
         with app.separator() as w:
             assert isinstance(w, tw.Separator)
Пример #22
0
 def test_combobox(self, app: GUI):
     with app.root():
         with app.combobox() as w:
             assert isinstance(w, tw.Combobox)
Пример #23
0
 def test_sizegrip(self, app: GUI):
     with app.root():
         with app.sizegrip() as w:
             assert isinstance(w, tw.Sizegrip)
Пример #24
0
 def test_frame(self, app: GUI):
     with app.root():
         with app.frame() as w:
             assert isinstance(w, tw.Frame)
Пример #25
0
 def test_spinbox(self, app: GUI):
     with app.root():
         with app.spinbox() as w:
             assert isinstance(w, tw.Spinbox)
Пример #26
0
 def test_labeled_scale(self, app: GUI):
     with app.root():
         with app.labeled_scale() as w:
             assert isinstance(w, tw.LabeledScale)
Пример #27
0
 def test_text(self, app: GUI):
     with app.root():
         with app.text() as w:
             assert isinstance(w, tw.Text)
Пример #28
0
 def test_menu(self, app: GUI):
     with app.root():
         with app.menu() as w:
             assert isinstance(w, tw.Menu)
Пример #29
0
def app() -> GUI:
    return GUI()