From aa97c28b6a9b468498fffe565d314b07141f163b Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Sun, 29 Jan 2017 14:47:07 -0500 Subject: Changed lib_openshift to use real temporary files. --- roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py') diff --git a/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py index 342da961b..08fc9f6df 100755 --- a/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py +++ b/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py @@ -149,18 +149,18 @@ metadata: mock_cmd.assert_has_calls([ mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None), mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None), - mock.call(['oc', '-n', 'default', 'replace', '-f', '/tmp/builder'], None), + mock.call(['oc', '-n', 'default', 'replace', '-f', mock.ANY], None), mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None) ]) mock_write.assert_has_calls([ - mock.call('/tmp/builder', builder_yaml_file) + mock.call(mock.ANY, builder_yaml_file) ]) @mock.patch('oc_serviceaccount_secret.Yedit._write') @mock.patch('oc_serviceaccount_secret.OCServiceAccountSecret._run') def test_removing_a_secret_to_a_serviceaccount(self, mock_cmd, mock_write): - ''' Testing adding a secret to a service account ''' + ''' Testing removing a secret to a service account ''' # Arrange @@ -241,11 +241,11 @@ metadata: mock_cmd.assert_has_calls([ mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None), mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None), - mock.call(['oc', '-n', 'default', 'replace', '-f', '/tmp/builder'], None), + mock.call(['oc', '-n', 'default', 'replace', '-f', mock.ANY], None), ]) mock_write.assert_has_calls([ - mock.call('/tmp/builder', builder_yaml_file) + mock.call(mock.ANY, builder_yaml_file) ]) def tearDown(self): -- cgit v1.2.3