def test_create_tags_invalid_parameters(self):
        # NOTE(ft): check tag validity checks
        self.assert_execution_error('InvalidParameterValue', 'CreateTags',
                                    {'ResourceId.1': fakes.ID_EC2_VPC_1,
                                     'Tag.1.Value': ''})

        self.assert_execution_error('InvalidParameterValue', 'CreateTags',
                                    {'ResourceId.1': fakes.ID_EC2_VPC_1,
                                     'Tag.1.Key': ''})

        self.assert_execution_error('InvalidParameterValue', 'CreateTags',
                                    {'ResourceId.1': fakes.ID_EC2_VPC_1,
                                     'Tag.1.Key': 'a' * 128})

        self.assert_execution_error('InvalidParameterValue', 'CreateTags',
                                    {'ResourceId.1': fakes.ID_EC2_VPC_1,
                                     'Tag.1.Key': 'fake-key',
                                     'Tag.1.Value': 'a' * 256})

        # NOTE(ft): check resource type check
        self.assert_execution_error(
            'InvalidID', 'CreateTags',
            {'ResourceId.1': fakes.random_ec2_id('fake'),
             'Tag.1.Key': 'fake-key',
             'Tag.1.Value': 'fake-value'})

        # NOTE(ft): check resource existence check
        self.db_api.get_item_by_id.return_value = None
        for r_id in tag_api.RESOURCE_TYPES:
            if r_id in ('ami', 'ari', 'aki'):
                continue
            exc_class = ec2utils.NOT_FOUND_EXCEPTION_MAP[r_id]
            try:
                error_code = exc_class.ec2_code
            except __HOLE__:
                error_code = exc_class.__name__
            self.assert_execution_error(
                error_code, 'CreateTags',
                {'ResourceId.1': fakes.random_ec2_id(r_id),
                 'Tag.1.Key': 'fake-key',
                 'Tag.1.Value': 'fake-value'})
dataset/ETHPy150Open openstack/ec2-api/ec2api/tests/unit/test_tag.py/TagTestCase.test_create_tags_invalid_parameters