~ubuntu-branches/ubuntu/lucid/landscape-client/lucid-updates

« back to all changes in this revision

Viewing changes to landscape/manager/tests/test_service.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2012-04-10 14:28:48 UTC
  • mfrom: (1.1.27)
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: package-import@ubuntu.com-20120410142848-7xsy4g2xii7y7ntc
ImportĀ upstreamĀ versionĀ 12.04.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from landscape.tests.mocker import ANY
2
1
from landscape.tests.helpers import (
3
2
    LandscapeTest, FakeBrokerServiceHelper)
4
3
from landscape.reactor import FakeReactor
42
41
        The L{ManagerService.startService} method connects to the broker,
43
42
        starts the plugins and register the manager as broker client.
44
43
        """
45
 
        # FIXME: don't actually run the real register method, because at the
46
 
        # moment the UserManager plugin still depends on DBus. We can probably
47
 
        # drop this mocking once the AMP migration is completed.
48
 
        for plugin in self.service.plugins:
49
 
            plugin.register = self.mocker.mock()
50
 
            plugin.register(ANY)
51
 
        self.mocker.replay()
52
 
 
53
44
        def stop_service(ignored):
 
45
            for plugin in self.service.plugins:
 
46
                if getattr(plugin, "stop", None) is not None:
 
47
                    plugin.stop()
54
48
            [connector] = self.broker_service.broker.get_connectors()
55
49
            connector.disconnect()
56
50
            self.service.stopService()