1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

PyFalkon: Add basictest

This commit is contained in:
David Rosca 2018-03-23 18:05:54 +01:00
parent 18cf0ce480
commit fd8cc0b356
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 24 additions and 0 deletions

View File

@ -7,3 +7,7 @@ endmacro()
add_executable(pyfalkontestrunner pyfalkontestrunner.cpp)
target_link_libraries(pyfalkontestrunner FalkonPrivate Qt5::Test)
pyfalkon_tests(
basictest
)

View File

@ -0,0 +1,20 @@
import Falkon
import unittest
class BasicTest(unittest.TestCase):
def test_module_version(self):
self.assertEqual(Falkon.__version__.count('.'), 2)
self.assertIsNotNone(Falkon.registerPlugin)
def test_mainapplication(self):
self.assertIsNotNone(Falkon.MainApplication.instance())
def test_create_window(self):
window = Falkon.MainApplication.instance().createWindow(Falkon.Qz.BW_NewWindow)
self.assertIsNotNone(window)
suite = unittest.defaultTestLoader.loadTestsFromTestCase(BasicTest)
if unittest.TextTestRunner().run(suite).failures:
raise(Exception("FAIL"))