1 | import unittest |
||
2 | from unittest.case import SkipTest |
||
3 | |||
4 | try: |
||
5 | from coalib import coala_dbus |
||
6 | except ImportError: |
||
7 | raise SkipTest("python-gi or python-dbus not installed") |
||
8 | |||
9 | |||
10 | class GlibMainLoopTest: |
||
11 | |||
12 | @staticmethod |
||
13 | def run(self): |
||
0 ignored issues
–
show
Best Practice
introduced
by
![]() |
|||
14 | raise AssertionError |
||
15 | |||
16 | |||
17 | class coalaDbusTest(unittest.TestCase): |
||
18 | |||
19 | def setUp(self): |
||
20 | self.glib_main_loop = GLib.MainLoop |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
21 | GLib.MainLoop = GlibMainLoopTest |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
22 | |||
23 | def tearDown(self): |
||
24 | GLib.MainLoop = self.glib_main_loop |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
25 | |||
26 | def test_main(self): |
||
27 | # Ensure we are able to setup dbus and create a mainloop |
||
28 | with self.assertRaises(AssertionError): |
||
29 | coala_dbus.main() |
||
30 |