diff options
Diffstat (limited to 'watcher_tempest_plugin/tests/api/admin/test_scoring_engine.py')
-rw-r--r-- | watcher_tempest_plugin/tests/api/admin/test_scoring_engine.py | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/watcher_tempest_plugin/tests/api/admin/test_scoring_engine.py b/watcher_tempest_plugin/tests/api/admin/test_scoring_engine.py deleted file mode 100644 index 466fe41..0000000 --- a/watcher_tempest_plugin/tests/api/admin/test_scoring_engine.py +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | # Copyright (c) 2016 b<>com | ||
2 | # | ||
3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4 | # you may not use this file except in compliance with the License. | ||
5 | # You may obtain 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, | ||
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
12 | # implied. | ||
13 | # See the License for the specific language governing permissions and | ||
14 | # limitations under the License. | ||
15 | |||
16 | from __future__ import unicode_literals | ||
17 | |||
18 | from tempest.lib import decorators | ||
19 | |||
20 | from watcher_tempest_plugin.tests.api.admin import base | ||
21 | |||
22 | |||
23 | class TestShowListScoringEngine(base.BaseInfraOptimTest): | ||
24 | """Tests for scoring engines""" | ||
25 | |||
26 | DUMMY_SCORING_ENGINE = "dummy_scorer" | ||
27 | |||
28 | @classmethod | ||
29 | def resource_setup(cls): | ||
30 | super(TestShowListScoringEngine, cls).resource_setup() | ||
31 | |||
32 | def assert_expected(self, expected, actual, | ||
33 | keys=('created_at', 'updated_at', 'deleted_at')): | ||
34 | super(TestShowListScoringEngine, self).assert_expected( | ||
35 | expected, actual, keys) | ||
36 | |||
37 | @decorators.attr(type='smoke') | ||
38 | def test_show_scoring_engine(self): | ||
39 | _, scoring_engine = self.client.show_scoring_engine( | ||
40 | self.DUMMY_SCORING_ENGINE) | ||
41 | |||
42 | self.assertEqual(self.DUMMY_SCORING_ENGINE, scoring_engine['name']) | ||
43 | |||
44 | expected_fields = {'metainfo', 'description', 'name', 'uuid', 'links'} | ||
45 | self.assertEqual(expected_fields, set(scoring_engine.keys())) | ||
46 | |||
47 | @decorators.attr(type='smoke') | ||
48 | def test_show_scoring_engine_with_links(self): | ||
49 | _, scoring_engine = self.client.show_scoring_engine( | ||
50 | self.DUMMY_SCORING_ENGINE) | ||
51 | self.assertIn('links', scoring_engine.keys()) | ||
52 | self.assertEqual(2, len(scoring_engine['links'])) | ||
53 | self.assertIn(scoring_engine['uuid'], | ||
54 | scoring_engine['links'][0]['href']) | ||
55 | |||
56 | @decorators.attr(type="smoke") | ||
57 | def test_list_scoring_engines(self): | ||
58 | _, body = self.client.list_scoring_engines() | ||
59 | self.assertIn(self.DUMMY_SCORING_ENGINE, | ||
60 | [i['name'] for i in body['scoring_engines']]) | ||
61 | |||
62 | # Verify self links. | ||
63 | for scoring_engine in body['scoring_engines']: | ||
64 | self.validate_self_link('scoring_engines', scoring_engine['uuid'], | ||
65 | scoring_engine['links'][0]['href']) | ||