def test_on_agent_state_update(self):
        """
        Simply test that it runs :-/
        """
        cache = self._create_app_state_cache()

        event = EventMock()
        event.path = '/foo/host'

        cache._path_to_host_mapping['host'] = {'/path/bar': {}}

        self.mox.ReplayAll()
        cache._on_agent_state_update(event)
        self.mox.VerifyAll()
    def test_on_agent_state_update(self):
        """
        Simply test that it runs :-/
        """
        cache = self._create_app_state_cache()

        event = EventMock()
        event.path = '/foo/host'

        cache._path_to_host_mapping['host'] = '/path/bar'

        self.mox.ReplayAll()
        cache._on_agent_state_update(event)
        self.mox.VerifyAll()
Example #3
0
    def test_on_update(self):
        cache = self._create_app_state_cache()

        self.mox.StubOutWithMock(cache, "_walk")
        cache._walk('path1', mox.IgnoreArg())

        event = EventMock()
        event.path = 'path1'

        self.time_estimate_cache.update_states(mox.IgnoreArg())

        self.mox.ReplayAll()
         
        cache._on_update(event)

        self.mox.VerifyAll()
    def test_on_update(self):
        cache = self._create_app_state_cache()

        self.mox.StubOutWithMock(cache, "_walk")
        cache._walk('path1', mox.IgnoreArg())

        event = EventMock()
        event.path = 'path1'

        self.time_estimate_cache.update_states(mox.IgnoreArg())

        self.mox.ReplayAll()

        cache._on_update(event)

        self.mox.VerifyAll()
Example #5
0
    def test_on_update(self):
        event = EventMock()
        cache = self._create_global_cache()
        self.socket_client1.write_message("globalmodejson")
        self.socket_client2.write_message("globalmodejson")

        self.mox.StubOutWithMock(cache, "get_mode")
        cache.get_mode().AndReturn(FakeMessage("globalmodejson"))

        self.mox.ReplayAll()
        cache.on_update(event)
        self.mox.VerifyAll()