1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
"""
SoftLayer.tests.CLI.modules.ssl_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import testing
import json
from unittest import mock as mock
class SslTests(testing.TestCase):
def test_list(self):
result = self.run_command(['ssl', 'list', '--status', 'all'])
self.assert_no_fail(result)
self.assertEqual(json.loads(result.output), [
{
"id": 1234,
"common_name": "cert",
"days_until_expire": 0,
"notes": None
}
])
@mock.patch('SoftLayer.CLI.formatting.no_going_back')
def test_remove(self, confirm_mock):
confirm_mock.return_value = True
result = self.run_command(['ssl', 'remove', '123456'])
self.assert_no_fail(result)
self.assertEqual(result.exit_code, 0)
def test_download(self):
result = self.run_command(['ssl', 'download', '123456'])
self.assert_no_fail(result)
self.assertEqual(result.exit_code, 0)
|