summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py')
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py34
1 files changed, 7 insertions, 27 deletions
diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
index ab8ccd18c..b22525068 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
@@ -1,14 +1,6 @@
-#!/usr/bin/env python2
'''
Unit tests for oc secret add
'''
-# To run:
-# ./oc_serviceaccount_secret.py
-#
-# .
-# Ran 1 test in 0.002s
-#
-# OK
import os
import six
@@ -38,10 +30,6 @@ class OCServiceAccountSecretTest(unittest.TestCase):
Test class for OCServiceAccountSecret
'''
- def setUp(self):
- ''' setup method will create a file and set to known configuration '''
- pass
-
@mock.patch('oc_serviceaccount_secret.locate_oc_binary')
@mock.patch('oc_serviceaccount_secret.Utils.create_tmpfile_copy')
@mock.patch('oc_serviceaccount_secret.Yedit._write')
@@ -181,10 +169,10 @@ secrets:
# Making sure our mocks were called as we expected
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', mock.ANY], None),
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None)
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'replace', '-f', mock.ANY, '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None)
])
yaml_file = builder_pyyaml_file
@@ -304,9 +292,9 @@ secrets:
# Making sure our mocks were called as we expected
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', mock.ANY], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'replace', '-f', mock.ANY, '-n', 'default'], None),
])
yaml_file = builder_pyyaml_file
@@ -424,11 +412,3 @@ secrets:
mock_shutil_which.side_effect = lambda _f, path=None: oc_bin
self.assertEqual(locate_oc_binary(), oc_bin)
-
- def tearDown(self):
- '''TearDown method'''
- pass
-
-
-if __name__ == "__main__":
- unittest.main()