diff options
author | Thomas Wiest <twiest@redhat.com> | 2017-01-29 14:47:07 -0500 |
---|---|---|
committer | Thomas Wiest <twiest@redhat.com> | 2017-02-08 01:04:00 -0500 |
commit | aa97c28b6a9b468498fffe565d314b07141f163b (patch) | |
tree | 1ad83e300ec589f9d4888293d2f62dc2c287af04 /roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py | |
parent | 5a933ed4b33131423b2f349eb0bc33ead99ec360 (diff) | |
download | openshift-aa97c28b6a9b468498fffe565d314b07141f163b.tar.gz openshift-aa97c28b6a9b468498fffe565d314b07141f163b.tar.bz2 openshift-aa97c28b6a9b468498fffe565d314b07141f163b.tar.xz openshift-aa97c28b6a9b468498fffe565d314b07141f163b.zip |
Changed lib_openshift to use real temporary files.
Diffstat (limited to 'roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py')
-rwxr-xr-x | roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py | 10 |
1 files changed, 5 insertions, 5 deletions
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): |