Fix unit tests with py3.6

In python3.6 the path used by os.path.join can be either
a string or bytes, so mock the neutron.common.config.init
to return a string so the tests pass with python3.6.

Change-Id: I10b399edb76b2ed3a2a235f9f4ec278ef94c4251
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
Chuck Short 2018-08-31 09:07:03 -04:00 committed by Andreas Jaeger
parent 8708ced355
commit de57190bca
1 changed files with 3 additions and 1 deletions

View File

@ -74,7 +74,9 @@ class TestBgpDrAgent(base.BaseTestCase):
self.driver_cls = self.driver_cls_p.start()
self.context = context.get_admin_context()
def test_bgp_dragent_manager(self):
@mock.patch('neutron.common.config.init')
def test_bgp_dragent_manager(self, mock_init):
mock_init.return_value = '/tmp/test'
state_rpc_str = 'neutron.agent.rpc.PluginReportStateAPI'
# sync_state is needed for this test
with mock.patch.object(bgp_dragent.BgpDrAgentWithStateReport,