From 25dd19618aecf69917720d10e0e9d7ba2925db14 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 20 Aug 2018 12:34:43 -0400 Subject: Fixes unit test failures Adds mocking some file opens introduced by: https://gerrit.opnfv.org/gerrit/#/c/60991/ Change-Id: I013b9c96a7c3f678c6e227f98cd58f9547d79ecb Signed-off-by: Tim Rozet --- apex/tests/test_apex_overcloud_deploy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py index 9dd5289d..1ba5dd90 100644 --- a/apex/tests/test_apex_overcloud_deploy.py +++ b/apex/tests/test_apex_overcloud_deploy.py @@ -454,6 +454,7 @@ class TestOvercloudDeploy(unittest.TestCase): @patch('apex.overcloud.deploy.fileinput') @patch('apex.overcloud.deploy.shutil') + @patch('builtins.open', mock_open()) def test_prep_env_round_two(self, mock_shutil, mock_fileinput): mock_fileinput.input.return_value = \ ['NeutronVPPAgentPhysnets'] @@ -499,6 +500,7 @@ class TestOvercloudDeploy(unittest.TestCase): @patch('apex.overcloud.deploy.fileinput') @patch('apex.overcloud.deploy.shutil') + @patch('builtins.open', mock_open()) def test_prep_env_round_three(self, mock_shutil, mock_fileinput): mock_fileinput.input.return_value = \ ['OS::TripleO::Services::NeutronDhcpAgent', @@ -541,6 +543,7 @@ class TestOvercloudDeploy(unittest.TestCase): @patch('apex.overcloud.deploy.fileinput') @patch('apex.overcloud.deploy.shutil') + @patch('builtins.open', mock_open()) def test_prep_env_tenant_vlan(self, mock_shutil, mock_fileinput): mock_fileinput.input.return_value = \ ['NeutronNetworkVLANRanges', @@ -591,6 +594,7 @@ class TestOvercloudDeploy(unittest.TestCase): @patch('apex.overcloud.deploy.fileinput') @patch('apex.overcloud.deploy.shutil') + @patch('builtins.open', mock_open()) def test_prep_env_tenant_vlan_odl(self, mock_shutil, mock_fileinput): mock_fileinput.input.return_value = \ ['NeutronNetworkVLANRanges', -- cgit 1.2.3-korg