Merge "Improve patching of sys.argv"

This commit is contained in:
Zuul 2019-01-15 13:42:02 +00:00 committed by Gerrit Code Review
commit a997500d07
1 changed files with 5 additions and 4 deletions

View File

@ -83,10 +83,11 @@ class TestBgpDrAgent(base.BaseTestCase):
'sync_state',
autospec=True) as mock_sync_state:
with mock.patch(state_rpc_str) as state_rpc:
with mock.patch.object(sys, 'argv') as sys_argv:
sys_argv.return_value = [
'bgp_dragent', '--config-file',
base.etcdir('neutron.conf')]
test_args = [
'bgp_dragent', '--config-file',
base.etcdir('neutron.conf')
]
with mock.patch.object(sys, 'argv', test_args):
config.register_agent_state_opts_helper(cfg.CONF)
n_config.init(sys.argv[1:])
agent_mgr = bgp_dragent.BgpDrAgentWithStateReport(