desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'tests False when thing type not created'
def test_that_when_creating_a_thing_type_fails_the_create_thing_type_method_returns_error(self):
self.conn.create_thing_type.side_effect = ClientError(error_content, 'create_thing_type') result = boto_iot.create_thing_type(thingTypeName=thing_type_name, thingTypeDescription=thing_type_desc, searchableAttributesList=[thing_type_attr_1], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('create_thing_type'))
'tests True when deprecate thing type succeeds'
def test_that_when_deprecating_a_thing_type_succeeds_the_deprecate_thing_type_method_returns_true(self):
self.conn.deprecate_thing_type.return_value = {} result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters) self.assertTrue(result.get('deprecated')) self.assertEqual(result.get('error'), None)
'tests False when thing type fails to deprecate'
def test_that_when_deprecating_a_thing_type_fails_the_deprecate_thing_type_method_returns_error(self):
self.conn.deprecate_thing_type.side_effect = ClientError(error_content, 'deprecate_thing_type') result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters) self.assertFalse(result.get('deprecated')) self.assertEqual(result.get('error', {}).get('message'), error_message.format('deprecate_thing_type'))
'tests True when delete thing type succeeds'
def test_that_when_deleting_a_thing_type_succeeds_the_delete_thing_type_method_returns_true(self):
self.conn.delete_thing_type.return_value = {} result = boto_iot.delete_thing_type(thingTypeName=thing_type_name, **conn_parameters) self.assertTrue(result.get('deleted')) self.assertEqual(result.get('error'), None)
'tests False when delete thing type fails'
def test_that_when_deleting_a_thing_type_fails_the_delete_thing_type_method_returns_error(self):
self.conn.delete_thing_type.side_effect = ClientError(error_content, 'delete_thing_type') result = boto_iot.delete_thing_type(thingTypeName=thing_type_name, **conn_parameters) self.assertFalse(result.get('deleted')) self.assertEqual(result.get('error', {}).get('message'), error_message.format('delete_thing_type'))
'Tests checking iot policy existence when the iot policy already exists'
def test_that_when_checking_if_a_policy_exists_and_a_policy_exists_the_policy_exists_method_returns_true(self):
self.conn.get_policy.return_value = {'policy': policy_ret} result = boto_iot.policy_exists(policyName=policy_ret['policyName'], **conn_parameters) self.assertTrue(result['exists'])
'Tests checking iot policy existence when the iot policy does not exist'
def test_that_when_checking_if_a_policy_exists_and_a_policy_does_not_exist_the_policy_exists_method_returns_false(self):
self.conn.get_policy.side_effect = not_found_error result = boto_iot.policy_exists(policyName='mypolicy', **conn_parameters) self.assertFalse(result['exists'])
'Tests checking iot policy existence when boto returns an error'
def test_that_when_checking_if_a_policy_exists_and_boto3_returns_an_error_the_policy_exists_method_returns_error(self):
self.conn.get_policy.side_effect = ClientError(error_content, 'get_policy') result = boto_iot.policy_exists(policyName='mypolicy', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('get_policy'))
'tests True policy created.'
def test_that_when_creating_a_policy_succeeds_the_create_policy_method_returns_true(self):
self.conn.create_policy.return_value = policy_ret result = boto_iot.create_policy(policyName=policy_ret['policyName'], policyDocument=policy_ret['policyDocument'], **conn_parameters) self.assertTrue(result['created'])
'tests False policy not created.'
def test_that_when_creating_a_policy_fails_the_create_policy_method_returns_error(self):
self.conn.create_policy.side_effect = ClientError(error_content, 'create_policy') result = boto_iot.create_policy(policyName=policy_ret['policyName'], policyDocument=policy_ret['policyDocument'], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('create_policy'))
'tests True policy deleted.'
def test_that_when_deleting_a_policy_succeeds_the_delete_policy_method_returns_true(self):
result = boto_iot.delete_policy(policyName='testpolicy', **conn_parameters) self.assertTrue(result['deleted'])
'tests False policy not deleted.'
def test_that_when_deleting_a_policy_fails_the_delete_policy_method_returns_false(self):
self.conn.delete_policy.side_effect = ClientError(error_content, 'delete_policy') result = boto_iot.delete_policy(policyName='testpolicy', **conn_parameters) self.assertFalse(result['deleted'])
'Tests describing parameters if policy exists'
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_true(self):
self.conn.get_policy.return_value = {'policy': policy_ret} result = boto_iot.describe_policy(policyName=policy_ret['policyName'], **conn_parameters) self.assertTrue(result['policy'])
'Tests describing parameters if policy does not exist'
def test_that_when_describing_policy_it_returns_the_dict_of_properties_returns_false(self):
self.conn.get_policy.side_effect = not_found_error result = boto_iot.describe_policy(policyName='testpolicy', **conn_parameters) self.assertFalse(result['policy'])
'Tests describing parameters failure'
def test_that_when_describing_policy_on_client_error_it_returns_error(self):
self.conn.get_policy.side_effect = ClientError(error_content, 'get_policy') result = boto_iot.describe_policy(policyName='testpolicy', **conn_parameters) self.assertTrue(('error' in result))
'Tests checking iot policy existence when the iot policy version already exists'
def test_that_when_checking_if_a_policy_version_exists_and_a_policy_version_exists_the_policy_version_exists_method_returns_true(self):
self.conn.get_policy.return_value = {'policy': policy_ret} result = boto_iot.policy_version_exists(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertTrue(result['exists'])
'Tests checking iot policy_version existence when the iot policy_version does not exist'
def test_that_when_checking_if_a_policy_version_exists_and_a_policy_version_does_not_exist_the_policy_version_exists_method_returns_false(self):
self.conn.get_policy_version.side_effect = not_found_error result = boto_iot.policy_version_exists(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertFalse(result['exists'])
'Tests checking iot policy_version existence when boto returns an error'
def test_that_when_checking_if_a_policy_version_exists_and_boto3_returns_an_error_the_policy_version_exists_method_returns_error(self):
self.conn.get_policy_version.side_effect = ClientError(error_content, 'get_policy_version') result = boto_iot.policy_version_exists(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('get_policy_version'))
'tests True policy_version created.'
def test_that_when_creating_a_policy_version_succeeds_the_create_policy_version_method_returns_true(self):
self.conn.create_policy_version.return_value = policy_ret result = boto_iot.create_policy_version(policyName=policy_ret['policyName'], policyDocument=policy_ret['policyDocument'], **conn_parameters) self.assertTrue(result['created'])
'tests False policy_version not created.'
def test_that_when_creating_a_policy_version_fails_the_create_policy_version_method_returns_error(self):
self.conn.create_policy_version.side_effect = ClientError(error_content, 'create_policy_version') result = boto_iot.create_policy_version(policyName=policy_ret['policyName'], policyDocument=policy_ret['policyDocument'], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('create_policy_version'))
'tests True policy_version deleted.'
def test_that_when_deleting_a_policy_version_succeeds_the_delete_policy_version_method_returns_true(self):
result = boto_iot.delete_policy_version(policyName='testpolicy', policyVersionId=1, **conn_parameters) self.assertTrue(result['deleted'])
'tests False policy_version not deleted.'
def test_that_when_deleting_a_policy_version_fails_the_delete_policy_version_method_returns_false(self):
self.conn.delete_policy_version.side_effect = ClientError(error_content, 'delete_policy_version') result = boto_iot.delete_policy_version(policyName='testpolicy', policyVersionId=1, **conn_parameters) self.assertFalse(result['deleted'])
'Tests describing parameters if policy_version exists'
def test_that_when_describing_policy_version_it_returns_the_dict_of_properties_returns_true(self):
self.conn.get_policy_version.return_value = {'policy': policy_ret} result = boto_iot.describe_policy_version(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertTrue(result['policy'])
'Tests describing parameters if policy_version does not exist'
def test_that_when_describing_policy_version_it_returns_the_dict_of_properties_returns_false(self):
self.conn.get_policy_version.side_effect = not_found_error result = boto_iot.describe_policy_version(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertFalse(result['policy'])
'Tests describing parameters failure'
def test_that_when_describing_policy_version_on_client_error_it_returns_error(self):
self.conn.get_policy_version.side_effect = ClientError(error_content, 'get_policy_version') result = boto_iot.describe_policy_version(policyName=policy_ret['policyName'], policyVersionId=1, **conn_parameters) self.assertTrue(('error' in result))
'tests True policies listed.'
def test_that_when_listing_policies_succeeds_the_list_policies_method_returns_true(self):
self.conn.list_policies.return_value = {'policies': [policy_ret]} result = boto_iot.list_policies(**conn_parameters) self.assertTrue(result['policies'])
'tests False no policy listed.'
def test_that_when_listing_policy_fails_the_list_policy_method_returns_false(self):
self.conn.list_policies.return_value = {'policies': []} result = boto_iot.list_policies(**conn_parameters) self.assertFalse(result['policies'])
'tests False policy error.'
def test_that_when_listing_policy_fails_the_list_policy_method_returns_error(self):
self.conn.list_policies.side_effect = ClientError(error_content, 'list_policies') result = boto_iot.list_policies(**conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_policies'))
'tests True policy versions listed.'
def test_that_when_listing_policy_versions_succeeds_the_list_policy_versions_method_returns_true(self):
self.conn.list_policy_versions.return_value = {'policyVersions': [policy_ret]} result = boto_iot.list_policy_versions(policyName='testpolicy', **conn_parameters) self.assertTrue(result['policyVersions'])
'tests False no policy versions listed.'
def test_that_when_listing_policy_versions_fails_the_list_policy_versions_method_returns_false(self):
self.conn.list_policy_versions.return_value = {'policyVersions': []} result = boto_iot.list_policy_versions(policyName='testpolicy', **conn_parameters) self.assertFalse(result['policyVersions'])
'tests False policy versions error.'
def test_that_when_listing_policy_versions_fails_the_list_policy_versions_method_returns_error(self):
self.conn.list_policy_versions.side_effect = ClientError(error_content, 'list_policy_versions') result = boto_iot.list_policy_versions(policyName='testpolicy', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_policy_versions'))
'tests True policy version set.'
def test_that_when_setting_default_policy_version_succeeds_the_set_default_policy_version_method_returns_true(self):
result = boto_iot.set_default_policy_version(policyName='testpolicy', policyVersionId=1, **conn_parameters) self.assertTrue(result['changed'])
'tests False policy version error.'
def test_that_when_set_default_policy_version_fails_the_set_default_policy_version_method_returns_error(self):
self.conn.set_default_policy_version.side_effect = ClientError(error_content, 'set_default_policy_version') result = boto_iot.set_default_policy_version(policyName='testpolicy', policyVersionId=1, **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('set_default_policy_version'))
'tests True policies listed.'
def test_that_when_list_principal_policies_succeeds_the_list_principal_policies_method_returns_true(self):
self.conn.list_principal_policies.return_value = {'policies': [policy_ret]} result = boto_iot.list_principal_policies(principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertTrue(result['policies'])
'tests False policy version error.'
def test_that_when_list_principal_policies_fails_the_list_principal_policies_method_returns_error(self):
self.conn.list_principal_policies.side_effect = ClientError(error_content, 'list_principal_policies') result = boto_iot.list_principal_policies(principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_principal_policies'))
'tests True policy attached.'
def test_that_when_attach_principal_policy_succeeds_the_attach_principal_policy_method_returns_true(self):
result = boto_iot.attach_principal_policy(policyName='testpolicy', principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertTrue(result['attached'])
'tests False policy version error.'
def test_that_when_attach_principal_policy_version_fails_the_attach_principal_policy_version_method_returns_error(self):
self.conn.attach_principal_policy.side_effect = ClientError(error_content, 'attach_principal_policy') result = boto_iot.attach_principal_policy(policyName='testpolicy', principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('attach_principal_policy'))
'tests True policy detached.'
def test_that_when_detach_principal_policy_succeeds_the_detach_principal_policy_method_returns_true(self):
result = boto_iot.detach_principal_policy(policyName='testpolicy', principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertTrue(result['detached'])
'tests False policy version error.'
def test_that_when_detach_principal_policy_version_fails_the_detach_principal_policy_version_method_returns_error(self):
self.conn.detach_principal_policy.side_effect = ClientError(error_content, 'detach_principal_policy') result = boto_iot.detach_principal_policy(policyName='testpolicy', principal='us-east-1:GUID-GUID-GUID', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('detach_principal_policy'))
'Tests checking iot topic_rule existence when the iot topic_rule already exists'
def test_that_when_checking_if_a_topic_rule_exists_and_a_topic_rule_exists_the_topic_rule_exists_method_returns_true(self):
self.conn.get_topic_rule.return_value = {'rule': topic_rule_ret} result = boto_iot.topic_rule_exists(ruleName=topic_rule_ret['ruleName'], **conn_parameters) self.assertTrue(result['exists'])
'Tests checking iot rule existence when the iot rule does not exist'
def test_that_when_checking_if_a_rule_exists_and_a_rule_does_not_exist_the_topic_rule_exists_method_returns_false(self):
self.conn.get_topic_rule.side_effect = topic_rule_not_found_error result = boto_iot.topic_rule_exists(ruleName='mypolicy', **conn_parameters) self.assertFalse(result['exists'])
'Tests checking iot topic_rule existence when boto returns an error'
def test_that_when_checking_if_a_topic_rule_exists_and_boto3_returns_an_error_the_topic_rule_exists_method_returns_error(self):
self.conn.get_topic_rule.side_effect = ClientError(error_content, 'get_topic_rule') result = boto_iot.topic_rule_exists(ruleName='myrule', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('get_topic_rule'))
'tests True topic_rule created.'
def test_that_when_creating_a_topic_rule_succeeds_the_create_topic_rule_method_returns_true(self):
self.conn.create_topic_rule.return_value = topic_rule_ret result = boto_iot.create_topic_rule(ruleName=topic_rule_ret['ruleName'], sql=topic_rule_ret['sql'], description=topic_rule_ret['description'], actions=topic_rule_ret['actions'], **conn_parameters) self.assertTrue(result['created'])
'tests False topic_rule not created.'
def test_that_when_creating_a_topic_rule_fails_the_create_topic_rule_method_returns_error(self):
self.conn.create_topic_rule.side_effect = ClientError(error_content, 'create_topic_rule') result = boto_iot.create_topic_rule(ruleName=topic_rule_ret['ruleName'], sql=topic_rule_ret['sql'], description=topic_rule_ret['description'], actions=topic_rule_ret['actions'], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('create_topic_rule'))
'tests True topic_rule replaced.'
def test_that_when_replacing_a_topic_rule_succeeds_the_replace_topic_rule_method_returns_true(self):
self.conn.replace_topic_rule.return_value = topic_rule_ret result = boto_iot.replace_topic_rule(ruleName=topic_rule_ret['ruleName'], sql=topic_rule_ret['sql'], description=topic_rule_ret['description'], actions=topic_rule_ret['actions'], **conn_parameters) self.assertTrue(result['replaced'])
'tests False topic_rule not replaced.'
def test_that_when_replacing_a_topic_rule_fails_the_replace_topic_rule_method_returns_error(self):
self.conn.replace_topic_rule.side_effect = ClientError(error_content, 'replace_topic_rule') result = boto_iot.replace_topic_rule(ruleName=topic_rule_ret['ruleName'], sql=topic_rule_ret['sql'], description=topic_rule_ret['description'], actions=topic_rule_ret['actions'], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('replace_topic_rule'))
'tests True topic_rule deleted.'
def test_that_when_deleting_a_topic_rule_succeeds_the_delete_topic_rule_method_returns_true(self):
result = boto_iot.delete_topic_rule(ruleName='testrule', **conn_parameters) self.assertTrue(result['deleted'])
'tests False topic_rule not deleted.'
def test_that_when_deleting_a_topic_rule_fails_the_delete_topic_rule_method_returns_false(self):
self.conn.delete_topic_rule.side_effect = ClientError(error_content, 'delete_topic_rule') result = boto_iot.delete_topic_rule(ruleName='testrule', **conn_parameters) self.assertFalse(result['deleted'])
'Tests describing parameters if topic_rule exists'
def test_that_when_describing_topic_rule_it_returns_the_dict_of_properties_returns_true(self):
self.conn.get_topic_rule.return_value = {'rule': topic_rule_ret} result = boto_iot.describe_topic_rule(ruleName=topic_rule_ret['ruleName'], **conn_parameters) self.assertTrue(result['rule'])
'Tests describing parameters failure'
def test_that_when_describing_topic_rule_on_client_error_it_returns_error(self):
self.conn.get_topic_rule.side_effect = ClientError(error_content, 'get_topic_rule') result = boto_iot.describe_topic_rule(ruleName='testrule', **conn_parameters) self.assertTrue(('error' in result))
'tests True topic_rules listed.'
def test_that_when_listing_topic_rules_succeeds_the_list_topic_rules_method_returns_true(self):
self.conn.list_topic_rules.return_value = {'rules': [topic_rule_ret]} result = boto_iot.list_topic_rules(**conn_parameters) self.assertTrue(result['rules'])
'tests False policy error.'
def test_that_when_listing_topic_rules_fails_the_list_topic_rules_method_returns_error(self):
self.conn.list_topic_rules.side_effect = ClientError(error_content, 'list_topic_rules') result = boto_iot.list_topic_rules(**conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_topic_rules'))
'Test for list SCSI devices, with details'
def test_ls_(self):
lsscsi = {'stdout': '[0:0:0:0] disk HP LOGICAL VOLUME 6.68 /dev/sda [8:0]', 'stderr': '', 'retcode': 0} lsscsi_size = {'stdout': '[0:0:0:0] disk HP LOGICAL VOLUME 6.68 /dev/sda [8:0] 1.20TB', 'stderr': '', 'retcode': 0} result = {'[0:0:0:0]': {'major': '8', 'lun': '0:0:0:0', 'device': '/dev/sda', 'model': 'LOGICAL VOLUME 6.68', 'minor': '0', 'size': None}} result_size = copy.deepcopy(result) result_size['[0:0:0:0]']['size'] = '1.20TB' mock = MagicMock(return_value='/usr/bin/lsscsi') with patch.object(salt.utils.path, 'which', mock): cmd_mock = MagicMock(return_value=lsscsi_size) with patch.dict(scsi.__salt__, {'cmd.run_all': cmd_mock}): self.assertDictEqual(scsi.ls_(), result_size) with patch.dict(lsscsi_size, {'retcode': 1, 'stderr': 'An error occurred'}): self.assertEqual(scsi.ls_(), 'An error occurred') with patch.dict(lsscsi_size, {'retcode': 1, 'stderr': "lsscsi: invalid option -- 's'\nUsage:"}): self.assertEqual(scsi.ls_(), "lsscsi: invalid option -- 's' - try get_size=False") cmd_mock = MagicMock(return_value=lsscsi) with patch.dict(scsi.__salt__, {'cmd.run_all': cmd_mock}): self.assertDictEqual(scsi.ls_(get_size=False), result) mock = MagicMock(return_value=None) with patch.object(salt.utils.path, 'which', mock): self.assertEqual(scsi.ls_(), 'scsi.ls not available - lsscsi command not found')
'Test for list scsi devices'
def test_rescan_all(self):
mock = MagicMock(side_effect=[False, True]) with patch.object(os.path, 'isdir', mock): self.assertEqual(scsi.rescan_all('host'), 'Host host does not exist') with patch.dict(scsi.__salt__, {'cmd.run': MagicMock(return_value='A')}): self.assertListEqual(scsi.rescan_all('host'), ['A'])
'Mock of get_quotas_tenant method'
@staticmethod def get_quotas_tenant():
return True
'Mock of list_quotas method'
@staticmethod def list_quotas():
return True
'Mock of show_quota method'
@staticmethod def show_quota(tenant_id):
return tenant_id
'Mock of update_quota method'
@staticmethod def update_quota(tenant_id, subnet, router, network, floatingip, port, security_group, security_group_rule):
return (tenant_id, subnet, router, network, floatingip, port, security_group, security_group_rule)
'Mock of delete_quota method'
@staticmethod def delete_quota(tenant_id):
return tenant_id
'Mock of list_extensions method'
@staticmethod def list_extensions():
return True
'Mock of list_ports method'
@staticmethod def list_ports():
return True
'Mock of show_port method'
@staticmethod def show_port(port):
return port
'Mock of create_port method'
@staticmethod def create_port(name, network, device_id, admin_state_up):
return (name, network, device_id, admin_state_up)
'Mock of update_port method'
@staticmethod def update_port(port, name, admin_state_up):
return (port, name, admin_state_up)
'Mock of delete_port method'
@staticmethod def delete_port(port):
return port
'Mock of list_networks method'
@staticmethod def list_networks():
return True
'Mock of show_network method'
@staticmethod def show_network(network):
return network
'Mock of create_network method'
@staticmethod def create_network(name, admin_state_up, router_ext, network_type, physical_network, segmentation_id, shared):
return (name, admin_state_up, router_ext, network_type, physical_network, segmentation_id, shared)
'Mock of update_network method'
@staticmethod def update_network(network, name):
return (network, name)
'Mock of delete_network method'
@staticmethod def delete_network(network):
return network
'Mock of list_subnets method'
@staticmethod def list_subnets():
return True
'Mock of show_subnet method'
@staticmethod def show_subnet(subnet):
return subnet
'Mock of create_subnet method'
@staticmethod def create_subnet(network, cidr, name, ip_version):
return (network, cidr, name, ip_version)
'Mock of update_subnet method'
@staticmethod def update_subnet(subnet, name):
return (subnet, name)
'Mock of delete_subnet method'
@staticmethod def delete_subnet(subnet):
return subnet
'Mock of list_routers method'
@staticmethod def list_routers():
return True
'Mock of show_router method'
@staticmethod def show_router(router):
return router
'Mock of create_router method'
@staticmethod def create_router(name, ext_network, admin_state_up):
return (name, ext_network, admin_state_up)
'Mock of update_router method'
@staticmethod def update_router(router, name, admin_state_up, **kwargs):
return (router, name, admin_state_up, kwargs)
'Mock of delete_router method'
@staticmethod def delete_router(router):
return router
'Mock of add_interface_router method'
@staticmethod def add_interface_router(router, subnet):
return (router, subnet)
'Mock of remove_interface_router method'
@staticmethod def remove_interface_router(router, subnet):
return (router, subnet)
'Mock of add_gateway_router method'
@staticmethod def add_gateway_router(router, ext_network):
return (router, ext_network)
'Mock of remove_gateway_router method'
@staticmethod def remove_gateway_router(router):
return router
'Mock of list_floatingips method'
@staticmethod def list_floatingips():
return True
'Mock of show_floatingip method'
@staticmethod def show_floatingip(floatingip_id):
return floatingip_id
'Mock of create_floatingip method'
@staticmethod def create_floatingip(floating_network, port):
return (floating_network, port)
'Mock of create_floatingip method'
@staticmethod def update_floatingip(floating_network, port):
return (floating_network, port)
'Mock of delete_floatingip method'
@staticmethod def delete_floatingip(floatingip_id):
return floatingip_id
'Mock of list_security_groups method'
@staticmethod def list_security_groups():
return True
'Mock of show_security_group method'
@staticmethod def show_security_group(security_group):
return security_group
'Mock of create_security_group method'
@staticmethod def create_security_group(name, description):
return (name, description)
'Mock of update_security_group method'
@staticmethod def update_security_group(security_group, name, description):
return (security_group, name, description)
'Mock of delete_security_group method'
@staticmethod def delete_security_group(security_group):
return security_group
'Mock of list_security_group_rules method'
@staticmethod def list_security_group_rules():
return True
'Mock of show_security_group_rule method'
@staticmethod def show_security_group_rule(security_group_rule_id):
return security_group_rule_id
'Mock of create_security_group_rule method'
@staticmethod def create_security_group_rule(security_group, remote_group_id, direction, protocol, port_range_min, port_range_max, ethertype):
return (security_group, remote_group_id, direction, protocol, port_range_min, port_range_max, ethertype)
'Mock of delete_security_group_rule method'
@staticmethod def delete_security_group_rule(security_group_rule_id):
return security_group_rule_id
'Mock of list_vpnservices method'
@staticmethod def list_vpnservices(retrieve_all, **kwargs):
return (retrieve_all, kwargs)
'Mock of show_vpnservice method'
@staticmethod def show_vpnservice(vpnservice, **kwargs):
return (vpnservice, kwargs)