1
# Copyright (c) 2015 IBM, Corp.
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
# not use this file except in compliance with the License. You may obtain
5
# a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
# License for the specific language governing permissions and limitations
17
from ironic.common import exception
18
from ironic.tests import base
21
class TestIronicException(base.TestCase):
22
def test____init__(self):
23
expected = '\xc3\xa9\xe0\xaf\xb2\xe0\xbe\x84'
25
message = chr(233) + chr(0x0bf2) + chr(3972)
27
message = unichr(233) + unichr(0x0bf2) + unichr(3972)
28
exc = exception.IronicException(message)
29
self.assertEqual(expected, exc.__str__())