Marc Koderer | 173fc06 | 2015-08-27 14:01:42 +0200 | [diff] [blame] | 1 | # Copyright (c) 2015 Deutsche Telekom AG |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # 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, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| 16 | from tempest.test_discover import plugins |
| 17 | |
| 18 | |
| 19 | class FakePlugin(plugins.TempestPlugin): |
| 20 | expected_load_test = ["my/test/path", "/home/dir"] |
Andrea Frittoli (andreaf) | 6d4d85a | 2016-06-21 17:20:31 +0100 | [diff] [blame] | 21 | expected_service_clients = [{'foo': 'bar'}] |
Marc Koderer | 173fc06 | 2015-08-27 14:01:42 +0200 | [diff] [blame] | 22 | |
| 23 | def load_tests(self): |
| 24 | return self.expected_load_test |
| 25 | |
| 26 | def register_opts(self, conf): |
| 27 | return |
| 28 | |
| 29 | def get_opt_lists(self): |
| 30 | return [] |
| 31 | |
Andrea Frittoli (andreaf) | 6d4d85a | 2016-06-21 17:20:31 +0100 | [diff] [blame] | 32 | def get_service_clients(self): |
| 33 | return self.expected_service_clients |
| 34 | |
Marc Koderer | 173fc06 | 2015-08-27 14:01:42 +0200 | [diff] [blame] | 35 | |
| 36 | class FakeStevedoreObj(object): |
| 37 | obj = FakePlugin() |
| 38 | |
| 39 | @property |
| 40 | def name(self): |
| 41 | return self._name |
| 42 | |
| 43 | def __init__(self, name='Test1'): |
| 44 | self._name = name |
Andrea Frittoli (andreaf) | 6d4d85a | 2016-06-21 17:20:31 +0100 | [diff] [blame] | 45 | |
| 46 | |
| 47 | class FakePluginNoServiceClients(plugins.TempestPlugin): |
| 48 | |
| 49 | def load_tests(self): |
| 50 | return [] |
| 51 | |
| 52 | def register_opts(self, conf): |
| 53 | return |
| 54 | |
| 55 | def get_opt_lists(self): |
| 56 | return [] |
| 57 | |
| 58 | |
| 59 | class FakeStevedoreObjNoServiceClients(object): |
| 60 | obj = FakePluginNoServiceClients() |
| 61 | |
| 62 | @property |
| 63 | def name(self): |
| 64 | return self._name |
| 65 | |
| 66 | def __init__(self, name='Test2'): |
| 67 | self._name = name |