Beispiel #1
0
 def test_run(self):
     with mock.patch('neutron.agent.linux.daemon.Pidfile'):
         with mock.patch('neutron.wsgi.Server') as Server:
             pd = ns_proxy.ProxyDaemon('pidfile', 9697, 'net_id',
                                       'router_id')
             pd.run()
             Server.assert_has_calls([
                 mock.call('neutron-network-metadata-proxy'),
                 mock.call().start(mock.ANY, 9697),
                 mock.call().wait()
             ])
Beispiel #2
0
 def test_init(self):
     with mock.patch('neutron.agent.linux.daemon.Pidfile'):
         pd = ns_proxy.ProxyDaemon('pidfile', 9697, 'net_id', 'router_id')
         self.assertEqual(pd.router_id, 'router_id')
         self.assertEqual(pd.network_id, 'net_id')