File: test_objects.py

package info (click to toggle)
txdbus 1.1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 964 kB
  • sloc: python: 6,658; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from twisted.trial import unittest

from txdbus import objects


class ObjectsTester(unittest.TestCase):

    def test_signature_validity(self):
        self.assertTrue(objects.isSignatureValid('foo', 'foo'))
        self.assertTrue(not objects.isSignatureValid('foo', None))
        self.assertTrue(not objects.isSignatureValid('foo', 'bar'))
        self.assertTrue(not objects.isSignatureValid(None, 'foo'))
        self.assertTrue(objects.isSignatureValid(None, None))

    def test_property_deletion(self):
        class Foo(object):
            p = objects.DBusProperty('foo')

        def d():
            f = Foo()
            del f.p

        self.assertRaises(AttributeError, d)