~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/tests/test_exception.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-04-17 09:28:31 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20150417092831-wu2awfbqomnzpeim
Tags: 2015.1~rc1-0ubuntu1
* New upstream milestone release:
  - d/control: Align with upstream dependencies
  - d/p/fix-requirements.patch: Dropped no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#    Copyright (c) 2015 IBM, Corp.
 
2
#
 
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
 
6
#
 
7
#         http://www.apache.org/licenses/LICENSE-2.0
 
8
#
 
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
 
13
#    under the License.
 
14
 
 
15
import six
 
16
 
 
17
from ironic.common import exception
 
18
from ironic.tests import base
 
19
 
 
20
 
 
21
class TestIronicException(base.TestCase):
 
22
    def test____init__(self):
 
23
        expected = '\xc3\xa9\xe0\xaf\xb2\xe0\xbe\x84'
 
24
        if six.PY3:
 
25
            message = chr(233) + chr(0x0bf2) + chr(3972)
 
26
        else:
 
27
            message = unichr(233) + unichr(0x0bf2) + unichr(3972)
 
28
        exc = exception.IronicException(message)
 
29
        self.assertEqual(expected, exc.__str__())