Repository: softlayer/softlayer-python
Pull request #1958 (2023-05-22 17:15:10)

Figure out why slcli vs list --tag <tagName> doesnt work properly
[#issue1957](https://github.com/softlayer/softlayer-python/issues/1957)

![image](https://github.com/softlayer/softlayer-python/assets/22535437/e676a3e4-8d2b-4794-949d-c76e97cdfaab)



Patch:
diff --git a/SoftLayer/CLI/account/billing_items.py b/SoftLayer/CLI/account/billing_items.py
index 0f16af2f..4ca7f4d7 100644
--- a/SoftLayer/CLI/account/billing_items.py
+++ b/SoftLayer/CLI/account/billing_items.py
@@ -10,24 +10,21 @@
 
 
 @click.command(cls=SLCommand)
-@click.option('--create', '-c', help='The date the billing item was created.')
-@click.option('--ordered', '-o', help='Name that ordered the item')
-@click.option('--category', '-C', help='Category name')
 @environment.pass_env
-def cli(env, create, category, ordered):
+def cli(env):
     """Lists billing items with some other useful information.
 
     Similiar to https://cloud.ibm.com/billing/billing-items
     """
 
     manager = AccountManager(env.client)
-    items = manager.get_account_billing_items(create, category)
-    table = item_table(items, ordered)
+    items = manager.get_account_billing_items()
+    table = item_table(items)
 
     env.fout(table)
 
 
-def item_table(items, ordered=None):
+def item_table(items):
     """Formats a table for billing items"""
     table = formatting.Table([
         "Id",
@@ -51,9 +48,7 @@ def item_table(items, ordered=None):
         if user:
             # ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
             ordered_by = user.get('displayName')
-        if ordered:
-            if ordered != ordered_by:
-                continue
+
         table.add_row([
             item.get('id'),
             create_date,
diff --git a/SoftLayer/CLI/block/list.py b/SoftLayer/CLI/block/list.py
index 274ed57b..0a24c0cf 100644
--- a/SoftLayer/CLI/block/list.py
+++ b/SoftLayer/CLI/block/list.py
@@ -21,6 +21,7 @@
         else '-',
         mask="storageType.keyName"),
     column_helper.Column('capacity_gb', ('capacityGb',), mask="capacityGb"),
+    column_helper.Column('bytes_used', ('bytesUsed',), mask="bytesUsed"),
     column_helper.Column('IOPs', ('provisionedIops',), mask="provisionedIops"),
     column_helper.Column('ip_addr', ('serviceResourceBackendIpAddress',),
                          mask="serviceResourceBackendIpAddress"),
@@ -41,6 +42,7 @@
     'datacenter',
     'storage_type',
     'capacity_gb',
+    'bytes_used',
     'IOPs',
     'ip_addr',
     'lunId',
diff --git a/SoftLayer/CLI/order/cancelation.py b/SoftLayer/CLI/order/cancelation.py
deleted file mode 100644
index 6bade7ac..00000000
--- a/SoftLayer/CLI/order/cancelation.py
+++ /dev/null
@@ -1,30 +0,0 @@
-"""List all cancelation."""
-# :license: MIT, see LICENSE for more details.
-import click
-
-from SoftLayer.CLI.command import SLCommand as SLCommand
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import formatting
-from SoftLayer.managers import ordering
-from SoftLayer import utils
-
-
-@click.command(cls=SLCommand)
-@environment.pass_env
-def cli(env):
-    """List all account cancelations"""
-    table = formatting.Table([
-        'Case Number', 'Items', 'Created', 'Status', 'Requested by'])
-
-    manager = ordering.OrderingManager(env.client)
-    cancelations = manager.get_all_cancelation()
-
-    for item in cancelations:
-        table.add_row([item.get('ticketId'), item.get('itemCount'),
-                       utils.clean_time(item.get('createDate'),
-                                        in_format='%Y-%m-%dT%H:%M:%S', out_format='%Y-%m-%d %H:%M'),
-                       item['status']['name'],
-                       item['user']['firstName'] + ' ' + item['user']['lastName']
-                       ])
-
-    env.fout(table)
diff --git a/SoftLayer/CLI/routes.py b/SoftLayer/CLI/routes.py
index 3922541f..8527c5ce 100644
--- a/SoftLayer/CLI/routes.py
+++ b/SoftLayer/CLI/routes.py
@@ -279,7 +279,6 @@
     ('order:quote-save', 'SoftLayer.CLI.order.quote_save:cli'),
     ('order:quote', 'SoftLayer.CLI.order.quote:cli'),
     ('order:lookup', 'SoftLayer.CLI.order.lookup:cli'),
-    ('order:cancelation', 'SoftLayer.CLI.order.cancelation:cli'),
 
     ('hardware', 'SoftLayer.CLI.hardware'),
     ('hardware:bandwidth', 'SoftLayer.CLI.hardware.bandwidth:cli'),
@@ -391,7 +390,6 @@
     ('user:remove-access', 'SoftLayer.CLI.user.remove_access:cli'),
     ('user:grant-access', 'SoftLayer.CLI.user.grant_access:cli'),
     ('user:vpn-password', 'SoftLayer.CLI.user.vpn_password:cli'),
-    ('user:apikey', 'SoftLayer.CLI.user.apikey:cli'),
 
     ('vlan', 'SoftLayer.CLI.vlan'),
     ('vlan:create', 'SoftLayer.CLI.vlan.create:cli'),
diff --git a/SoftLayer/CLI/user/apikey.py b/SoftLayer/CLI/user/apikey.py
deleted file mode 100644
index c94643d6..00000000
--- a/SoftLayer/CLI/user/apikey.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""Allows to create, remove or refresh user's API authentication key."""
-import click
-
-import SoftLayer
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import helpers
-
-
-@click.command(cls=SoftLayer.CLI.command.SLCommand, )
-@click.argument('identifier')
-@click.option('--add', is_flag=True, default=False,
-              help="Create an user's API authentication key.")
-@click.option('--remove', is_flag=True, default=False,
-              help="Remove an user's API authentication key.")
-@click.option('--refresh', is_flag=True, default=False,
-              help="Refresh an user's API authentication key.")
-@environment.pass_env
-def cli(env, identifier, add, remove, refresh):
-
-    """Allows to create, remove or refresh user's API authentication key.
-
-    Each user can only have a single API key.
-    """
-
-    options = {
-        '--add': add,
-        '--remove': remove,
-        '--refresh': refresh,
-    }
-
-    if not any(options.values()):
-        raise exceptions.CLIAbort(f'At least one option is required: [{",".join(options.keys())}]')
-
-    if sum(options.values()) > 1:
-        raise exceptions.CLIAbort(f'Can only specify one option of [{",".join(options.keys())}]')
-
-    mgr = SoftLayer.UserManager(env.client)
-    user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
-
-    if remove or refresh:
-        mgr.remove_api_authentication_key(user_id)
-        click.secho('Successfully removed API authentication key', fg='green')
-
-    if add or refresh:
-        api_authentication_key = mgr.add_api_authentication_key(user_id)
-        click.secho(f'Successfully added. New API Authentication Key: {api_authentication_key}', fg='green')
diff --git a/SoftLayer/CLI/virt/list.py b/SoftLayer/CLI/virt/list.py
index ee525ede..4357a69c 100644
--- a/SoftLayer/CLI/virt/list.py
+++ b/SoftLayer/CLI/virt/list.py
@@ -54,6 +54,7 @@
 @click.option('--network', '-n', help='Network port speed in Mbps')
 @click.option('--hourly', is_flag=True, help='Show only hourly instances')
 @click.option('--monthly', is_flag=True, help='Show only monthly instances')
+@click.option('--tag', '-t', help='list of tags')
 @click.option('--transient', help='Filter by transient instances', type=click.BOOL)
 @click.option('--search', is_flag=False, flag_value="", default=None,
               help="Use the more flexible Search API to list instances. See `slcli search --types` for list " +
diff --git a/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py b/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py
deleted file mode 100644
index f5bdb59a..00000000
--- a/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py
+++ /dev/null
@@ -1,25 +0,0 @@
-getAllCancellationRequests = [
-    {"createDate": "2023-04-20T06:53:17-06:00",
-     "id": 123456,
-     "ticketId": 147258,
-     "itemCount": 1,
-     "items": [
-         {
-             "billingItemId": 369852,
-             "id": 147852369,
-             "billingItem": {
-                 "cancellationDate": "2023-05-03T22:59:59-06:00",
-                 "categoryCode": "server",
-             }
-         }
-     ],
-     "status": {
-         "id": 4,
-         "name": "Approved"
-     },
-     "user": {
-         "firstName": "CHRISTOPHER",
-         "id": 167758,
-         "lastName": "GALLO"
-     }
-     }]
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Storage.py b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
index b6097c71..0854e6ba 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Storage.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
@@ -257,9 +257,3 @@
 convertCloneDependentToIndependent = {
     'dependentDuplicate': 1
 }
-
-getDuplicateConversionStatus = {
-    'activeConversionStartTime': '2023-01-01',
-    'deDuplicateConversionPercentage': 50,
-    'volumeUsername': 'testUser'
-}
diff --git a/SoftLayer/fixtures/SoftLayer_User_Customer.py b/SoftLayer/fixtures/SoftLayer_User_Customer.py
index b53ea5e9..7bd3de7d 100644
--- a/SoftLayer/fixtures/SoftLayer_User_Customer.py
+++ b/SoftLayer/fixtures/SoftLayer_User_Customer.py
@@ -84,8 +84,7 @@
 removeBulkPortalPermission = True
 createObject = getObject
 editObject = True
-addApiAuthenticationKey = "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a"
-removeApiAuthenticationKey = True
+addApiAuthenticationKey = True
 updateVpnUser = True
 removeDedicatedHostAccess = True
 removeHardwareAccess = True
@@ -95,17 +94,6 @@
 addVirtualGuestAccess = True
 updateVpnPassword = True
 
-getApiAuthenticationKeys = [
-    {
-        "authenticationKey": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
-        "id": 123456,
-        "timestampKey": 12121212,
-        "userId": 111111
-    }
-]
-
-getEmptyApiAuthenticationKeys = []
-
 getHardware = [{
         "domain": "testedit.com",
         "fullyQualifiedDomainName": "test.testedit.com",
diff --git a/SoftLayer/managers/account.py b/SoftLayer/managers/account.py
index 54080e65..a07312f9 100644
--- a/SoftLayer/managers/account.py
+++ b/SoftLayer/managers/account.py
@@ -203,7 +203,7 @@ def get_billing_items(self, identifier):
             limit=100
         )
 
-    def get_account_billing_items(self, create=None, category=None, mask=None):
+    def get_account_billing_items(self, mask=None):
         """Gets all the topLevelBillingItems currently active on the account
 
         :param string mask: Object Mask
@@ -226,13 +226,6 @@ def get_account_billing_items(self, create=None, category=None, mask=None):
             }
         }
 
-        if category:
-            object_filter = utils.dict_merge(object_filter,
-                                             {"allTopLevelBillingItems": {"categoryCode": {"operation": category}}})
-        if create:
-            object_filter = utils.dict_merge(object_filter,
-                                             {"allTopLevelBillingItems": {"createDate": {"operation": create}}})
-
         return self.client.call('Account', 'getAllTopLevelBillingItems',
                                 mask=mask, filter=object_filter, iter=True, limit=100)
 
diff --git a/SoftLayer/managers/cdn.py b/SoftLayer/managers/cdn.py
index 703e6f14..61e32d41 100644
--- a/SoftLayer/managers/cdn.py
+++ b/SoftLayer/managers/cdn.py
@@ -140,6 +140,7 @@ def purge_content(self, unique_id, path):
         :param str path: A string of url or path that should be purged.
         :returns: A Container_Network_CdnMarketplace_Configuration_Cache_Purge array object
         """
+        path = f"/{path}"
         return self.cdn_purge.createPurge(unique_id, path)
 
     def get_usage_metrics(self, unique_id, history=30, frequency="aggregate"):
diff --git a/SoftLayer/managers/image.py b/SoftLayer/managers/image.py
index 893ccc67..26043a8a 100644
--- a/SoftLayer/managers/image.py
+++ b/SoftLayer/managers/image.py
@@ -70,7 +70,7 @@ def list_private_images(self, guid=None, name=None, **kwargs):
         account = self.client['Account']
         return account.getPrivateBlockDeviceTemplateGroups(**kwargs)
 
-    def list_public_images(self, guid=None, name=None, limit=100, **kwargs):
+    def list_public_images(self, guid=None, name=None, **kwargs):
         """List all public images.
 
         :param string guid: filter based on GUID
@@ -89,7 +89,7 @@ def list_public_images(self, guid=None, name=None, limit=100, **kwargs):
 
         kwargs['filter'] = _filter.to_dict()
 
-        return self.vgbdtg.getPublicImages(**kwargs, limit=limit)
+        return self.vgbdtg.getPublicImages(**kwargs)
 
     def _get_ids_from_name_public(self, name):
         """Get public images which match the given name."""
diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py
index e68c55b1..778d7bab 100644
--- a/SoftLayer/managers/ordering.py
+++ b/SoftLayer/managers/ordering.py
@@ -19,7 +19,6 @@
 PRESET_MASK = '''id, name, keyName, description, prices[id, hourlyRecurringFee, recurringFee], locations'''
 
 
-# pylint: disable=R0904
 class OrderingManager(object):
     """Manager to help ordering via the SoftLayer API.
 
@@ -746,12 +745,3 @@ def delete_quote(self, quote_id):
         """
 
         return self.client['SoftLayer_Billing_Order_Quote'].deleteQuote(id=quote_id)
-
-    def get_all_cancelation(self, limit=50):
-        """returns the all cancelations, completed orders"""
-
-        mask = 'mask[id,itemCount,modifyDate,createDate,ticketId,' \
-               'ticket[assignedUserId,id,' \
-               'serviceProviderResourceId],status[name,id],user[id,firstName,lastName]]'
-        return self.client.call('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests',
-                                mask=mask, limit=limit)
diff --git a/SoftLayer/managers/user.py b/SoftLayer/managers/user.py
index dfec39bb..b0d85fcd 100644
--- a/SoftLayer/managers/user.py
+++ b/SoftLayer/managers/user.py
@@ -332,26 +332,6 @@ def add_api_authentication_key(self, user_id):
         """
         return self.user_service.addApiAuthenticationKey(id=user_id)
 
-    def get_api_authentication_keys(self, user_id):
-        """Calls SoftLayer_User_Customer::getApiAuthenticationKeys
-
-        :param int user_id: User to add API key to
-        """
-        return self.user_service.getApiAuthenticationKeys(id=user_id)
-
-    def remove_api_authentication_key(self, user_id):
-        """Calls SoftLayer_User_Customer::getApiAuthenticationKeys and
-
-        SoftLayer_User_Customer::removeApiAuthenticationKey
-
-        :param int user_id: User to remove API key
-        """
-        api_authentication_keys = self.get_api_authentication_keys(user_id)
-        if len(api_authentication_keys) == 0:
-            return True
-
-        return self.user_service.removeApiAuthenticationKey(api_authentication_keys[0]['id'])
-
     def vpn_manual(self, user_id, value):
         """Enable or disable the manual config of subnets.
 
diff --git a/docs/cli/ordering.rst b/docs/cli/ordering.rst
index b4f70749..93d578cf 100644
--- a/docs/cli/ordering.rst
+++ b/docs/cli/ordering.rst
@@ -143,10 +143,6 @@ Quotes
     :prog: order quote-delete
     :show-nested:
 
-.. click:: SoftLayer.CLI.order.cancelation:cli
-    :prog: order cancelation
-    :show-nested:
-
 Lookup
 ======
 .. click:: SoftLayer.CLI.order.lookup:cli
diff --git a/docs/cli/users.rst b/docs/cli/users.rst
index e3d45bb1..c1f2d79e 100644
--- a/docs/cli/users.rst
+++ b/docs/cli/users.rst
@@ -64,7 +64,3 @@ Version 5.6.0 introduces the ability to interact with user accounts from the cli
     :prog: user vpn-password
     :show-nested:
 
-.. click:: SoftLayer.CLI.user.apikey:cli
-    :prog: user apikey
-    :show-nested:
-


Test patch:
diff --git a/tests/CLI/modules/account_tests.py b/tests/CLI/modules/account_tests.py
index 39913f59..d45c70aa 100644
--- a/tests/CLI/modules/account_tests.py
+++ b/tests/CLI/modules/account_tests.py
@@ -127,21 +127,6 @@ def test_account_billing_items(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
 
-    def test_account_billing_items_by_category(self):
-        result = self.run_command(['account', 'billing-items', '--category', 'server'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
-    def test_account_billing_items_by_ordered(self):
-        result = self.run_command(['account', 'billing-items', '--ordered', 'Test'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
-    def test_account_billing_items_create(self):
-        result = self.run_command(['account', 'billing-items', '--create', '04-21-2023'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
     # slcli account item-detail
     def test_account_get_billing_item_detail(self):
         result = self.run_command(['account', 'item-detail', '12345'])
@@ -195,23 +180,3 @@ def test_order_upgrade(self):
         result = self.run_command(['account', 'orders', '--upgrades'])
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getUpgradeRequests')
-
-    def test_account_events(self):
-        result = self.run_command(['account', 'events', '--date-min', '5/9/2023'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_planned_events(self):
-        result = self.run_command(['account', 'events', '--planned'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_unplanned_events(self):
-        result = self.run_command(['account', 'events', '--unplanned'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_announcement_events(self):
-        result = self.run_command(['account', 'events', '--announcement'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
diff --git a/tests/CLI/modules/block_tests.py b/tests/CLI/modules/block_tests.py
index ce5dd727..27a20c92 100644
--- a/tests/CLI/modules/block_tests.py
+++ b/tests/CLI/modules/block_tests.py
@@ -122,6 +122,7 @@ def test_volume_list(self):
         self.assert_no_fail(result)
         self.assertEqual([
             {
+                'bytes_used': None,
                 'capacity_gb': 20,
                 'datacenter': 'dal05',
                 'id': 100,
@@ -857,9 +858,3 @@ def test_object_permissions(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Network_Storage_Hub_Cleversafe_Account', 'getObject')
         self.assert_called_with('SoftLayer_Network_Storage_Hub_Cleversafe_Account', 'getEndpoints')
-
-    def test_block_duplicate_covert_status(self):
-        result = self.run_command(['block', 'duplicate-convert-status', '12345678'])
-
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Network_Storage', 'getDuplicateConversionStatus')
diff --git a/tests/CLI/modules/order_tests.py b/tests/CLI/modules/order_tests.py
index dc2c892a..c175e1b8 100644
--- a/tests/CLI/modules/order_tests.py
+++ b/tests/CLI/modules/order_tests.py
@@ -415,11 +415,6 @@ def test_quote_list(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getActiveQuotes')
 
-    def test_cancelation(self):
-        result = self.run_command(['order', 'cancelation'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests')
-
     def _get_order_items(self):
         item1 = {'keyName': 'ITEM1', 'description': 'description1',
                  'itemCategory': {'categoryCode': 'cat1'},
diff --git a/tests/CLI/modules/sshkey_tests.py b/tests/CLI/modules/sshkey_tests.py
index 85817590..c4646f7b 100644
--- a/tests/CLI/modules/sshkey_tests.py
+++ b/tests/CLI/modules/sshkey_tests.py
@@ -118,7 +118,7 @@ def test_print_key(self):
                          {'id': 1234, 'label': 'label', 'notes': 'notes'})
 
     def test_print_key_file(self):
-        if sys.platform.startswith("win"):
+        if (sys.platform.startswith("win")):
             self.skipTest("Test doesn't work in Windows")
         with tempfile.NamedTemporaryFile() as sshkey_file:
             service = self.client['Security_Ssh_Key']
diff --git a/tests/CLI/modules/user_tests.py b/tests/CLI/modules/user_tests.py
index 02956e68..f863da2f 100644
--- a/tests/CLI/modules/user_tests.py
+++ b/tests/CLI/modules/user_tests.py
@@ -10,7 +10,6 @@
 
 from unittest import mock as mock
 
-from SoftLayer.fixtures import SoftLayer_User_Customer
 from SoftLayer import testing
 
 
@@ -388,31 +387,3 @@ def test_remove_without_password(self):
         result = self.run_command(['user', 'vpn-password', '123456'])
         self.assertEqual(2, result.exit_code)
         self.assertIn("Missing option '--password'", result.output)
-
-    def test_api_key_without_option(self):
-        result = self.run_command(['user', 'apikey', '123456'])
-        self.assertEqual(2, result.exit_code)
-        self.assertIn('At least one option is required', result.exception.message)
-
-    def test_api_key_with_all_option(self):
-        result = self.run_command(['user', 'apikey', '123456', '--add', '--remove', '--refresh'])
-        self.assertEqual(2, result.exit_code)
-        self.assertIn('Can only specify one option', result.exception.message)
-
-    def test_remove_api_authentication_key_without_api_key(self):
-        mock = self.set_mock('SoftLayer_User_Customer', 'getApiAuthenticationKeys')
-        mock.return_value = SoftLayer_User_Customer.getEmptyApiAuthenticationKeys
-        result = self.run_command(['user', 'apikey', '123456', '--remove'])
-        self.assert_no_fail(result)
-
-    def test_add_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--add'])
-        self.assert_no_fail(result)
-
-    def test_remove_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--remove'])
-        self.assert_no_fail(result)
-
-    def test_refresh_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--refresh'])
-        self.assert_no_fail(result)
diff --git a/tests/CLI/modules/vs/vs_create_tests.py b/tests/CLI/modules/vs/vs_create_tests.py
index 06ea63d9..e2e43904 100644
--- a/tests/CLI/modules/vs/vs_create_tests.py
+++ b/tests/CLI/modules/vs/vs_create_tests.py
@@ -692,7 +692,7 @@ def test_create_vs_no_confirm(self, confirm_mock):
         self.assertEqual(result.exit_code, 2)
 
     def test_create_vs_export(self):
-        if sys.platform.startswith("win"):
+        if (sys.platform.startswith("win")):
             self.skipTest("Test doesn't work in Windows")
         with tempfile.NamedTemporaryFile() as config_file:
             result = self.run_command(['vs', 'create', '--hostname', 'TEST', '--export', config_file.name,
diff --git a/tests/managers/cdn_tests.py b/tests/managers/cdn_tests.py
index 6a220e28..5001331d 100644
--- a/tests/managers/cdn_tests.py
+++ b/tests/managers/cdn_tests.py
@@ -109,7 +109,7 @@ def test_remove_origin(self):
                                 args=args)
 
     def test_purge_content(self):
-        self.cdn_client.purge_content("12345", "/example1")
+        self.cdn_client.purge_content("12345", "example1")
 
         args = ("12345",
                 "/example1")
diff --git a/tests/managers/ordering_tests.py b/tests/managers/ordering_tests.py
index 1fb79bd2..e38b137f 100644
--- a/tests/managers/ordering_tests.py
+++ b/tests/managers/ordering_tests.py
@@ -905,7 +905,3 @@ def test_get_regions(self):
     def test_delete_quote(self):
         self.ordering.delete_quote(123)
         self.assert_called_with('SoftLayer_Billing_Order_Quote', 'deleteQuote')
-
-    def test_get_all_cancelations(self):
-        self.ordering.get_all_cancelation()
-        self.assert_called_with('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests')
diff --git a/tests/managers/user_tests.py b/tests/managers/user_tests.py
index 2d50d820..0fca5e2f 100644
--- a/tests/managers/user_tests.py
+++ b/tests/managers/user_tests.py
@@ -334,15 +334,3 @@ def test_remove_dedicated(self):
     def test_update_vpn_password(self):
         self.manager.update_vpn_password(123456, "Mypassword1.")
         self.assert_called_with('SoftLayer_User_Customer', 'updateVpnPassword')
-
-    def test_add_api_authentication_key(self):
-        self.manager.add_api_authentication_key(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'addApiAuthenticationKey')
-
-    def test_get_api_authentication_keys(self):
-        self.manager.get_api_authentication_keys(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'getApiAuthenticationKeys')
-
-    def test_remove_api_authentication_key(self):
-        self.manager.remove_api_authentication_key(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'removeApiAuthenticationKey')