~ubuntu-branches/ubuntu/quantal/ubuntu-system-service/quantal-updates

« back to all changes in this revision

Viewing changes to test/test_dbus

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-07-25 18:35:38 UTC
  • Revision ID: james.westby@ubuntu.com-20110725183538-5vwnk12hrnlap7e6
Tags: 0.1.26
* backend/system-service-d:
  - do not return True for is_reboot_required if there are still
    package manager operations in progres
* test/Makefile, .bzr-buildpackage/default.conf:
  - modernize and run during bzr-buildpackage

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import dbus
 
4
import os
 
5
import unittest
 
6
 
 
7
class TestDbus(unittest.TestCase):
 
8
 
 
9
    def setUp(self):
 
10
        self.system_bus = dbus.SystemBus()
 
11
        self.iface = dbus.Interface(
 
12
            self.system_bus.get_object("com.ubuntu.SystemService","/"),
 
13
            "com.ubuntu.SystemService")
 
14
 
 
15
    def test_is_package_system_locked(self):
 
16
        # just check if it not raises
 
17
        res = self.iface.is_package_system_locked()
 
18
        self.assertTrue( res in [True, False] )
 
19
 
 
20
    def test_is_reboot_required(self):
 
21
        # just check that it does not raise
 
22
        res = self.iface.is_reboot_required()
 
23
        self.assertTrue( res in [True, False] )
 
24
 
 
25
    def test_get_proxy(self):
 
26
        for proto in ["http", "https", "ftp"]:
 
27
            res = self.iface.get_proxy(proto)
 
28
            # ensure we get a string
 
29
            self.assertTrue( isinstance(res, dbus.String) )
 
30
 
 
31
    
 
32
 
 
33
if __name__ == "__main__":
 
34
    unittest.main()