deb-heat/heat/tests/test_support.py
Pavlo Shchelokovskyy 50ff4ec2fe Order imports in alphabetical order (9/9)
This patch fixes all the missed and newly introduced violations of the H306
style checking rule and enables it in tox.

Change-Id: I5566e66421d5397c0103958f02ea38e6e3c68892
Implements: blueprint reduce-flake8-ignored-rules (partial)
2014-05-22 16:49:51 +03:00

49 lines
1.8 KiB
Python

#
# 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 heat.engine import support
from heat.tests.common import HeatTestCase
class SupportStatusTest(HeatTestCase):
def test_valid_status(self):
status = support.SupportStatus(
status=support.DEPRECATED,
message='test_message',
version='test_version'
)
self.assertEqual('DEPRECATED', status.status)
self.assertEqual('test_message', status.message)
self.assertEqual('test_version', status.version)
self.assertEqual({
'status': 'DEPRECATED',
'message': 'test_message',
'version': 'test_version'
}, status.to_dict())
def test_invalid_status(self):
status = support.SupportStatus(
status='RANDOM',
message='test_message',
version='test_version'
)
self.assertEqual(support.UNKNOWN, status.status)
self.assertEqual('Specified status is invalid, defaulting to UNKNOWN',
status.message)
self.assertIsNone(status.version)
self.assertEqual({
'status': 'UNKNOWN',
'message': 'Specified status is invalid, defaulting to UNKNOWN',
'version': None
}, status.to_dict())