-
-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathtest_builderfont.py
46 lines (36 loc) · 1.11 KB
/
test_builderfont.py
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
# encoding: utf8
import os
import sys
import unittest
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.font as tkfont
import fixpath
import pygubu
import support
class TestBuilderFont(unittest.TestCase):
def setUp(self):
support.root_deiconify()
xmldata = "test_builderfont.ui"
self.builder = builder = pygubu.Builder()
builder.add_from_file(xmldata)
self.font = font = tkfont.Font(
family="Helvetica", size=32, weight="bold"
)
builder.set_font("custom_font", font)
self.widget = builder.get_object("mainwindow")
def tearDown(self):
support.root_withdraw()
@unittest.skip("Not implemented yet")
def test_get_font(self):
font = self.builder.get_font("custom_font")
self.assertEqual(self.font, font)
self.widget.destroy()
@unittest.skip("Not implemented yet")
def test_get_font_notset(self):
fname = "other_font"
font = self.builder.get_font(fname)
self.assertEqual(fname, font)
self.widget.destroy()
if __name__ == "__main__":
unittest.main()