Created new unittest model.
Separete unittest for module.
Only run unittest for compiled modules.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
471486732b
commit
ab918abc1e
211 changed files with 241 additions and 79 deletions
|
|
@ -1,30 +0,0 @@
|
|||
import unittest
|
||||
import os
|
||||
from helper import UsesQApplication
|
||||
|
||||
from PySide.QtGui import *
|
||||
from PySide.QtUiTools import *
|
||||
|
||||
def get_file_path():
|
||||
for path in file_path:
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
return ""
|
||||
|
||||
class QUioaderTeste(UsesQApplication):
|
||||
def testLoadFile(self):
|
||||
filePath = os.path.join(os.path.dirname(__file__), 'test.ui')
|
||||
loader = QUiLoader()
|
||||
parent = QWidget()
|
||||
w = loader.load(filePath, parent)
|
||||
self.assertNotEqual(w, None)
|
||||
|
||||
self.assertEqual(len(parent.children()), 1)
|
||||
|
||||
child = w.findChild(QWidget, "child_object")
|
||||
self.assertNotEqual(child, None)
|
||||
self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue