コード例 #1
0
 def test_run(self):
     with mock.patch('quantum.agent.linux.daemon.Pidfile'):
         with mock.patch('quantum.wsgi.Server') as Server:
             pd = ns_proxy.ProxyDaemon('pidfile', 9697, 'net_id',
                                       'router_id')
             pd.run()
             Server.assert_has_calls([
                 mock.call('quantum-network-metadata-proxy'),
                 mock.call().start(mock.ANY, 9697),
                 mock.call().wait()
             ])
コード例 #2
0
 def test_init(self):
     with mock.patch('quantum.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')