forked from alejandroautalan/pygubu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_menu.py
38 lines (30 loc) · 927 Bytes
/
test_menu.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
# encoding: utf8
import os
import sys
import unittest
try:
import tkinter as tk
import tkinter.ttk as ttk
except:
import Tkinter as tk
import ttk
pygubu_basedir = os.path.abspath(os.path.dirname(
os.path.dirname(os.path.realpath(sys.argv[0]))))
if pygubu_basedir not in sys.path:
sys.path.insert(0, pygubu_basedir)
import pygubu
import support
class TestMenu(unittest.TestCase):
def setUp(self):
support.root_deiconify()
xmldata = 'test_menu.ui'
self.builder = builder = pygubu.Builder()
filepath = os.path.dirname(os.path.realpath(__file__))
builder.add_resource_path(filepath)
builder.add_from_file(xmldata)
self.widget = builder.get_object('mainmenu')
def tearDown(self):
support.root_withdraw()
def test_class(self):
self.assertIsInstance(self.widget, tk.Menu)
self.widget.destroy()