c125fd1479
* The following commit sync the code from following hash: start_hash: 7279aa35851110a4933a10b58b2758a2bc3933a3 end_hash: 6e911a49a9e630878f4c46f61fde3964be550880 Change-Id: I371aa4d5f043f695df04b98b0f485c8f0548f2b3
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# Copyright 2016 FUJITSU LIMITED
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from neutron_lib.api.definitions import metering as metering_apidef
|
|
from neutron_lib.db import constants as db_const
|
|
from tempest.lib import decorators
|
|
from tempest.lib import exceptions as lib_exc
|
|
|
|
from neutron_tempest_plugin.api import base
|
|
|
|
LONG_NAME_NG = 'x' * (db_const.NAME_FIELD_SIZE + 1)
|
|
|
|
|
|
class MeteringNegativeTestJSON(base.BaseAdminNetworkTest):
|
|
|
|
required_extensions = [metering_apidef.ALIAS]
|
|
|
|
@decorators.attr(type='negative')
|
|
@decorators.idempotent_id('8b3f7c84-9d37-4771-8681-bfd2c07f3c2d')
|
|
def test_create_metering_label_with_too_long_name(self):
|
|
self.assertRaises(lib_exc.BadRequest,
|
|
self.admin_client.create_metering_label,
|
|
name=LONG_NAME_NG)
|