~ubuntu-branches/ubuntu/precise/landscape-client/precise-proposed

« back to all changes in this revision

Viewing changes to landscape/monitor/tests/test_plugin.py

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Hasenack
  • Date: 2011-07-18 15:16:18 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110718151618-f5ibg8v611x13sus
Tags: 11.07.1.1-0ubuntu0.11.10.0
* Try to load the old persist file if the current one doesn't exist or is
  empty (LP: #809210).
* Fallback to gethostname to get something interesting out of get_fqdn.
* Fix wrong ownership and permissions when the reporter is run as a result
  of applying a repository profile (LP: #804008).
* Keep original sources.list ownership (LP: #804548).
* Refactored tests (LP: #805746).
* Preserve permissions of sources.list (LP: #804548).
* Added a broker command line option (--record) that saves exchanges with the
  server to the filesystem
* Detect if running in a vmware guest (LP: #795794).
* Report VM type when run in the cloud (LP: #797069).
* Report VM type in non-cloud registration (LP: #795752).
* Report the package reporter result even in case of success, not just in
  case of failure (LP: #780406).
* Report package reporter errors (LP: #732490).
* Fix dependencies for hardy removing references to python 2.4 packages for
  pycurl and dbus (LP: #759764).
* The landscape client now reports whether it is running on a virtual machine
  or not.
* Add a plugin which manages APT sources.list and the associated GPG keys
  (LP: #758928).
* Limit the number of items in a network message to 200, to prevent problems
  when communication is interrupted with the server and the client
  accumulates too many network items, thus overloading the server when it's
  available again (LP: #760486).
* Updated version number in __init__.py so that the client reports the
  correct one in its user-agent string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        plugin.persist_name = "wubble"
29
29
        plugin.register(self.monitor)
30
30
        plugin.persist.set("hi", "there")
31
 
        self.assertEquals(self.monitor.persist.get("wubble"), {"hi": "there"})
 
31
        self.assertEqual(self.monitor.persist.get("wubble"), {"hi": "there"})
32
32
 
33
33
    def test_with_no_run_interval(self):
34
34
        """
90
90
        self.mstore.add_schema(Message("wubble", {"wubblestuff": Int()}))
91
91
 
92
92
    def test_get_message(self):
93
 
        self.assertEquals(self.plugin.get_message(),
94
 
                          {"type": "wubble", "wubblestuff": 1})
 
93
        self.assertEqual(self.plugin.get_message(),
 
94
                         {"type": "wubble", "wubblestuff": 1})
95
95
 
96
96
    def test_get_message_unchanging(self):
97
 
        self.assertEquals(self.plugin.get_message(),
98
 
                          {"type": "wubble", "wubblestuff": 1})
99
 
        self.assertEquals(self.plugin.get_message(), None)
 
97
        self.assertEqual(self.plugin.get_message(),
 
98
                         {"type": "wubble", "wubblestuff": 1})
 
99
        self.assertEqual(self.plugin.get_message(), None)
100
100
 
101
101
    def test_basic_exchange(self):
102
102
        # Is this really want we want to do?
103
103
        self.mstore.set_accepted_types(["wubble"])
104
104
        self.plugin.exchange()
105
105
        messages = self.mstore.get_pending_messages()
106
 
        self.assertEquals(messages[0]["type"], "wubble")
107
 
        self.assertEquals(messages[0]["wubblestuff"], 1)
 
106
        self.assertEqual(messages[0]["type"], "wubble")
 
107
        self.assertEqual(messages[0]["wubblestuff"], 1)
108
108
        self.assertIn("Queueing a message with updated data watcher info for "
109
109
                      "landscape.monitor.tests.test_plugin.StubDataWatching"
110
110
                      "Plugin.", self.logfile.getvalue())
115
115
        self.plugin.exchange()
116
116
        self.plugin.exchange()
117
117
        messages = self.mstore.get_pending_messages()
118
 
        self.assertEquals(len(messages), 1)
 
118
        self.assertEqual(len(messages), 1)
119
119
 
120
120
    def test_urgent_exchange(self):
121
121
        """