summaryrefslogtreecommitdiff
path: root/watcher_tempest_plugin/tests/api/admin/test_goal.py
diff options
context:
space:
mode:
Diffstat (limited to 'watcher_tempest_plugin/tests/api/admin/test_goal.py')
-rw-r--r--watcher_tempest_plugin/tests/api/admin/test_goal.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/watcher_tempest_plugin/tests/api/admin/test_goal.py b/watcher_tempest_plugin/tests/api/admin/test_goal.py
deleted file mode 100644
index 2cf228e..0000000
--- a/watcher_tempest_plugin/tests/api/admin/test_goal.py
+++ /dev/null
@@ -1,66 +0,0 @@
1# -*- encoding: utf-8 -*-
2# Copyright (c) 2016 b<>com
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17from __future__ import unicode_literals
18
19from tempest.lib import decorators
20
21from watcher_tempest_plugin.tests.api.admin import base
22
23
24class TestShowListGoal(base.BaseInfraOptimTest):
25 """Tests for goals"""
26
27 DUMMY_GOAL = "dummy"
28
29 @classmethod
30 def resource_setup(cls):
31 super(TestShowListGoal, cls).resource_setup()
32
33 def assert_expected(self, expected, actual,
34 keys=('created_at', 'updated_at', 'deleted_at')):
35 super(TestShowListGoal, self).assert_expected(
36 expected, actual, keys)
37
38 @decorators.attr(type='smoke')
39 def test_show_goal(self):
40 _, goal = self.client.show_goal(self.DUMMY_GOAL)
41
42 self.assertEqual(self.DUMMY_GOAL, goal['name'])
43 expected_fields = {
44 'created_at', 'deleted_at', 'display_name',
45 'efficacy_specification', 'links', 'name',
46 'updated_at', 'uuid'}
47 self.assertEqual(expected_fields, set(goal.keys()))
48
49 @decorators.attr(type='smoke')
50 def test_show_goal_with_links(self):
51 _, goal = self.client.show_goal(self.DUMMY_GOAL)
52 self.assertIn('links', goal.keys())
53 self.assertEqual(2, len(goal['links']))
54 self.assertIn(goal['uuid'],
55 goal['links'][0]['href'])
56
57 @decorators.attr(type="smoke")
58 def test_list_goals(self):
59 _, body = self.client.list_goals()
60 self.assertIn(self.DUMMY_GOAL,
61 [i['name'] for i in body['goals']])
62
63 # Verify self links.
64 for goal in body['goals']:
65 self.validate_self_link('goals', goal['uuid'],
66 goal['links'][0]['href'])