Example #1
0
    def test_main(self):
        with mock.patch.object(agent, "UnixDomainMetadataProxy") as proxy:
            with mock.patch.object(agent, "config") as config:
                with mock.patch.object(agent, "cfg") as cfg:
                    with mock.patch.object(utils, "cfg"):
                        agent.main()

                        self.assertTrue(config.setup_logging.called)
                        proxy.assert_has_calls([mock.call(cfg.CONF), mock.call().run()])
Example #2
0
    def test_main(self):
        with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
            with mock.patch.object(agent, 'config') as config:
                with mock.patch.object(agent, 'cfg') as cfg:
                    with mock.patch.object(utils, 'cfg'):
                        agent.main()

                        self.assertTrue(config.setup_logging.called)
                        proxy.assert_has_calls(
                            [mock.call(cfg.CONF),
                             mock.call().run()])
Example #3
0
    def test_main(self):
        with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
            with mock.patch('eventlet.monkey_patch') as eventlet:
                with mock.patch.object(agent, 'config') as config:
                    with mock.patch.object(agent, 'cfg') as cfg:
                        with mock.patch.object(utils, 'cfg'):
                            agent.main()

                            self.assertTrue(eventlet.called)
                            self.assertTrue(config.setup_logging.called)
                            proxy.assert_has_calls([
                                mock.call(cfg.CONF),
                                mock.call().run()]
                            )