File: test_gobject.py

package info (click to toggle)
blueman 2.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,428 kB
  • sloc: python: 11,744; sh: 5,063; makefile: 899; ansic: 343; xml: 207; sed: 16
file content (22 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from unittest import TestCase

from gi.repository.GObject import GObject

from blueman.gobject import SingletonGObjectMeta


class TestGObjectMeta(TestCase):
    class A(GObject, metaclass=SingletonGObjectMeta):
        pass

    class B(GObject, metaclass=SingletonGObjectMeta):
        pass

    def test_instantiation(self):
        self.assertIsInstance(self.A(), GObject)

    def test_singleton(self):
        self.assertEqual(self.A(), self.A())

    def test_separation(self):
        self.assertNotEqual(self.A(), self.B())