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_secret.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'roles/lib_openshift/src/test/unit/oc_secret.py') diff --git a/roles/lib_openshift/src/test/unit/oc_secret.py b/roles/lib_openshift/src/test/unit/oc_secret.py index c81f0514b..645aac82b 100755 --- a/roles/lib_openshift/src/test/unit/oc_secret.py +++ b/roles/lib_openshift/src/test/unit/oc_secret.py @@ -35,9 +35,10 @@ class OCSecretTest(unittest.TestCase): ''' setup method will create a file and set to known configuration ''' pass + @mock.patch('oc_secret.Utils.create_tmpfile_copy') @mock.patch('oc_secret.Utils._write') @mock.patch('oc_secret.OCSecret._run') - def test_adding_a_secret(self, mock_cmd, mock_write): + def test_adding_a_secret(self, mock_cmd, mock_write, mock_tmpfile_copy): ''' Testing adding a secret ''' # Arrange @@ -64,6 +65,10 @@ class OCSecretTest(unittest.TestCase): (0, 'secret/testsecretname', ''), ] + mock_tmpfile_copy.side_effect = [ + '/tmp/mocked_kubeconfig', + ] + # Act results = OCSecret.run_ansible(params, False) -- cgit v1.2.3