Skip to content

Commit e681da9

Browse files
author
Brian Flores
committed
added test when user does not have api key
1 parent 230f4ba commit e681da9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/CLI/modules/user_tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from unittest import mock as mock
1212

13+
from SoftLayer.fixtures import SoftLayer_User_Customer
1314
from SoftLayer import testing
1415

1516

@@ -398,6 +399,12 @@ def test_api_key_with_all_option(self):
398399
self.assertEqual(2, result.exit_code)
399400
self.assertIn('Can only specify one option', result.exception.message)
400401

402+
def test_remove_api_authentication_key_without_api_key(self):
403+
mock = self.set_mock('SoftLayer_User_Customer', 'getApiAuthenticationKeys')
404+
mock.return_value = SoftLayer_User_Customer.getEmptyApiAuthenticationKeys
405+
result = self.run_command(['user', 'apikey', '123456', '--remove'])
406+
self.assert_no_fail(result)
407+
401408
def test_add_api_authentication_key(self):
402409
result = self.run_command(['user', 'apikey', '123456', '--add'])
403410
self.assert_no_fail(result)

0 commit comments

Comments
 (0)