2014-07-24 11:48:28 -03:00
|
|
|
import unittest
|
2014-08-21 04:00:41 -03:00
|
|
|
import Tkinter as tkinter
|
2014-07-24 11:48:28 -03:00
|
|
|
import tkFont as font
|
|
|
|
from test.test_support import requires, run_unittest
|
2014-08-24 03:07:09 -03:00
|
|
|
from test_ttk.support import AbstractTkTest
|
2014-07-24 11:48:28 -03:00
|
|
|
|
|
|
|
requires('gui')
|
|
|
|
|
2014-08-24 03:07:09 -03:00
|
|
|
class FontTest(AbstractTkTest, unittest.TestCase):
|
2014-07-24 11:48:28 -03:00
|
|
|
|
|
|
|
def test_font_eq(self):
|
|
|
|
fontname = "TkDefaultFont"
|
|
|
|
try:
|
2014-08-24 03:07:09 -03:00
|
|
|
f = font.Font(root=self.root, name=fontname, exists=True)
|
2014-08-21 04:00:41 -03:00
|
|
|
except tkinter._tkinter.TclError:
|
2014-08-24 03:07:09 -03:00
|
|
|
f = font.Font(root=self.root, name=fontname, exists=False)
|
|
|
|
font1 = font.Font(root=self.root, name=fontname, exists=True)
|
|
|
|
font2 = font.Font(root=self.root, name=fontname, exists=True)
|
2014-07-24 11:48:28 -03:00
|
|
|
self.assertIsNot(font1, font2)
|
|
|
|
self.assertEqual(font1, font2)
|
|
|
|
self.assertNotEqual(font1, font1.copy())
|
|
|
|
self.assertNotEqual(font1, 0)
|
|
|
|
self.assertNotIn(font1, [0])
|
|
|
|
|
|
|
|
tests_gui = (FontTest, )
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
run_unittest(*tests_gui)
|