From 04ea66c4ab6cd1e5daa217526d7c9591aa164f10 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Wed, 8 Feb 2017 10:23:48 -0500 Subject: Added temporary kubeconfig file. Fixed tests to coincide with tmpfile. --- roles/lib_openshift/src/test/unit/oc_serviceaccount.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'roles/lib_openshift/src/test/unit/oc_serviceaccount.py') diff --git a/roles/lib_openshift/src/test/unit/oc_serviceaccount.py b/roles/lib_openshift/src/test/unit/oc_serviceaccount.py index dab751bb9..256b569eb 100755 --- a/roles/lib_openshift/src/test/unit/oc_serviceaccount.py +++ b/roles/lib_openshift/src/test/unit/oc_serviceaccount.py @@ -35,8 +35,9 @@ class OCServiceAccountTest(unittest.TestCase): ''' setup method will create a file and set to known configuration ''' pass + @mock.patch('oc_serviceaccount.Utils.create_tmpfile_copy') @mock.patch('oc_serviceaccount.OCServiceAccount._run') - def test_adding_a_serviceaccount(self, mock_cmd): + def test_adding_a_serviceaccount(self, mock_cmd, mock_tmpfile_copy): ''' Testing adding a serviceaccount ''' # Arrange @@ -90,6 +91,10 @@ class OCServiceAccountTest(unittest.TestCase): (0, valid_result_json, ''), ] + mock_tmpfile_copy.side_effect = [ + '/tmp/mocked_kubeconfig', + ] + # Act results = OCServiceAccount.run_ansible(params, False) -- cgit v1.2.3