summaryrefslogtreecommitdiff
path: root/watcher_tempest_plugin/tests/api/admin/test_strategy.py
diff options
context:
space:
mode:
Diffstat (limited to 'watcher_tempest_plugin/tests/api/admin/test_strategy.py')
-rw-r--r--watcher_tempest_plugin/tests/api/admin/test_strategy.py69
1 files changed, 0 insertions, 69 deletions
diff --git a/watcher_tempest_plugin/tests/api/admin/test_strategy.py b/watcher_tempest_plugin/tests/api/admin/test_strategy.py
deleted file mode 100644
index 73eefd7..0000000
--- a/watcher_tempest_plugin/tests/api/admin/test_strategy.py
+++ /dev/null
@@ -1,69 +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 TestShowListStrategy(base.BaseInfraOptimTest):
25 """Tests for strategies"""
26
27 DUMMY_STRATEGY = "dummy"
28
29 @classmethod
30 def resource_setup(cls):
31 super(TestShowListStrategy, cls).resource_setup()
32
33 def assert_expected(self, expected, actual,
34 keys=('created_at', 'updated_at', 'deleted_at')):
35 super(TestShowListStrategy, self).assert_expected(
36 expected, actual, keys)
37
38 @decorators.attr(type='smoke')
39 def test_show_strategy(self):
40 _, strategy = self.client.show_strategy(self.DUMMY_STRATEGY)
41
42 self.assertEqual(self.DUMMY_STRATEGY, strategy['name'])
43 self.assertIn("display_name", strategy.keys())
44
45 @decorators.attr(type='smoke')
46 def test_show_strategy_with_links(self):
47 _, strategy = self.client.show_strategy(self.DUMMY_STRATEGY)
48 self.assertIn('links', strategy.keys())
49 self.assertEqual(2, len(strategy['links']))
50 self.assertIn(strategy['uuid'],
51 strategy['links'][0]['href'])
52
53 @decorators.attr(type="smoke")
54 def test_list_strategies(self):
55 _, body = self.client.list_strategies()
56 self.assertIn('strategies', body)
57 strategies = body['strategies']
58 self.assertIn(self.DUMMY_STRATEGY,
59 [i['name'] for i in body['strategies']])
60
61 for strategy in strategies:
62 self.assertTrue(
63 all(val is not None for key, val in strategy.items()
64 if key in ['uuid', 'name', 'display_name', 'goal_uuid']))
65
66 # Verify self links.
67 for strategy in body['strategies']:
68 self.validate_self_link('strategies', strategy['uuid'],
69 strategy['links'][0]['href'])