forked from slightlynybbled/tk_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_basic.py
More file actions
54 lines (39 loc) · 1.04 KB
/
test_basic.py
File metadata and controls
54 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import tkinter as tk
import pytest
from tk_tools import *
@pytest.fixture
def root():
root_frame = tk.Tk()
yield root_frame
try:
root_frame.destroy()
except:
pass
def test_version():
assert isinstance(__version__, str)
def test_init(root):
"""
Ensures that all elements of the GUI may be instantiated
without errors.
"""
RotaryScale(root).grid()
Gauge(root).grid()
Graph(root, 0, 10, 0, 10, 0.1, 0.1).grid()
Led(root).grid()
EntryGrid(root, 3).grid()
LabelGrid(root, 3).grid()
ButtonGrid(root, 3).grid()
KeyValueEntry(root, keys=['1', '2']).grid()
SmartOptionMenu(root, ['1', '2']).grid()
SmartSpinBox(root).grid()
SmartCheckbutton(root).grid()
Calendar(root).grid()
MultiSlotFrame(root).grid()
SevenSegmentDigits(root).grid()
BinaryLabel(root).grid()
bl = BinaryLabel(root)
bl.grid()
ToolTip(bl, 'some text')
# if the test suite makes it to here, then all widgets
# have been successfully instantiated
assert True