-
-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathtest_text_issue58.py
37 lines (29 loc) · 886 Bytes
/
test_text_issue58.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
# encoding: utf-8
import os
import sys
import unittest
import tkinter as tk
import tkinter.ttk as ttk
import fixpath
import pygubu
import support
expected_text = """In the designer:
- Add a text widget
- Set state to disabled
- Enter content in the text property
- Text content should be set by pygubu-designer.
"""
class TestText(unittest.TestCase):
def setUp(self):
support.root_deiconify()
xmldata = "test_text_issue58.ui"
self.builder = builder = pygubu.Builder()
builder.add_from_file(xmldata)
self.widget = builder.get_object("mainframe")
self.text = builder.get_object("Text_1")
def tearDown(self):
support.root_withdraw()
def test_set_text_in_disabled_status(self):
text_content = self.text.get("0.0", tk.END)
self.assertEqual(text_content, expected_text)
self.widget.destroy()