Merge "Raises an error if the queue name is empty"
This commit is contained in:
commit
6c615fdb43
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient._i18n import _ # noqa
|
||||
from zaqarclient import errors
|
||||
from zaqarclient.queues.v1 import claim as claim_api
|
||||
from zaqarclient.queues.v1 import core
|
||||
@ -25,6 +26,9 @@ class Queue(object):
|
||||
def __init__(self, client, name, auto_create=True):
|
||||
self.client = client
|
||||
|
||||
if name == "":
|
||||
raise ValueError(_('Queue name does not have a value'))
|
||||
|
||||
# NOTE(flaper87) Queue Info
|
||||
self._name = name
|
||||
self._metadata = None
|
||||
|
@ -66,6 +66,9 @@ class QueuesV1QueueUnitTest(base.QueuesTestBase):
|
||||
# just checking our way down to the transport
|
||||
# doesn't crash.
|
||||
|
||||
def test_queue_valid_name(self):
|
||||
self.assertRaises(ValueError, self.client.queue, "")
|
||||
|
||||
def test_queue_delete(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
Loading…
x
Reference in New Issue
Block a user