Add support for Python 3.5

This fixes a test that check too much of the output formatting. Just
test that some of the values we expect are there.

Change-Id: I43a2c2d017bc99ef045ff2e4c5943f1607343ec1
This commit is contained in:
Julien Danjou 2016-07-27 15:27:30 +02:00
parent cfea4aed4a
commit f0faf477af
3 changed files with 7 additions and 67 deletions

View File

@ -538,72 +538,11 @@ class ShellAlarmGnocchiCommandTest(test_shell.ShellTestBase):
ceilometer_shell.\
do_alarm_gnocchi_aggregation_by_metrics_threshold_create(
self.cc, self.args)
self.assertEqual('''\
+---------------------------+------------------------------------------\
--------------------------+
| Property | Value \
|
+---------------------------+------------------------------------------\
--------------------------+
| aggregation_method | count \
|
| alarm_actions | ["http://something/alarm"] \
|
| alarm_id | b69ecdb9-f19b-4fb5-950f-5eb53938b718 \
|
| comparison_operator | le \
|
| description | description_gnocchi_alarm \
|
| enabled | True \
|
| evaluation_periods | 3 \
|
| granularity | 60 \
|
| insufficient_data_actions | ["http://something/insufficient"] \
|
| metrics | ["b3d9d8ab-05e8-439f-89ad-5e978dd2a5eb", \
"009d4faf-c275-46f0-8f2d- |
| | 670b15bac2b0"] \
|
| name | name_gnocchi_alarm \
|
| ok_actions | ["http://something/ok"] \
|
| project_id | 97fcad0402ce4f65ac3bd42a0c6a7e74 \
|
| repeat_actions | True \
|
| severity | critical \
|
| state | ok \
|
| threshold | 70.0 \
|
| time_constraints | [{name: cons1, \
|
| | description: desc1, \
|
| | start: 0 11 * * *, \
|
| | duration: 300}, \
|
| | {name: cons2, \
|
| | description: desc2, \
|
| | start: 0 23 * * *, \
|
| | duration: 600}] \
|
| type | gnocchi_aggregation_by_metrics_threshold \
|
| user_id | f28735621ee84f329144eb467c91fce6 \
|
+---------------------------+------------------------------------------\
--------------------------+
''', sys.stdout.getvalue())
stdout = sys.stdout.getvalue()
self.assertIn("b69ecdb9-f19b-4fb5-950f-5eb53938b718", stdout)
self.assertIn("[\"http://something/alarm\"]", stdout)
self.assertIn("description_gnocchi_alarm", stdout)
self.assertIn("gnocchi_aggregation_by_metrics_threshold", stdout)
@mock.patch('sys.stdout', new=six.StringIO())
def test_do_alarm_gnocchi_aggr_by_resources_threshold_create(self):

View File

@ -17,6 +17,7 @@ classifier =
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
[files]
packages =

View File

@ -1,5 +1,5 @@
[tox]
envlist = py34,py27,pypy,pep8
envlist = py34,py35,py27,pypy,pep8
minversion = 1.6
skipsdist = True