Completed
Pull Request — master (#1511)
by Abdeali
01:35
created

coalib.tests.GlibMainLoopTest.run()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
import unittest
2
from unittest.case import SkipTest
3
4
try:
5
    from coalib import coala_dbus
6
    from gi.repository import GLib
7
except ImportError:
8
    raise SkipTest("python-gi or python-dbus not installed")
9
10
11
class GlibMainLoopTest:
12
13
    @staticmethod
14
    def run():
15
        raise AssertionError
16
17
18
class coalaDbusTest(unittest.TestCase):
19
20
    def setUp(self):
21
        self.glib_main_loop = GLib.MainLoop
22
        GLib.MainLoop = GlibMainLoopTest
23
24
    def tearDown(self):
25
        GLib.MainLoop = self.glib_main_loop
26
27
    def test_main(self):
28
        # Ensure we are able to setup dbus and create a mainloop
29
        with self.assertRaises(AssertionError):
30
            coala_dbus.main()
31