Browse Source

Tests for testing config

Change-Id: Ib3cecd40ff897ffbc654fd07e750f585da3ec598
Andreas Scheuring 2 years ago
parent
commit
345b2cd601

+ 0
- 0
os_dpm/tests/unit/__init__.py View File


+ 0
- 0
os_dpm/tests/unit/config/__init__.py View File


+ 36
- 0
os_dpm/tests/unit/config/test_config.py View File

@@ -0,0 +1,36 @@
1
+# Copyright 2017 IBM Corp. All Rights Reserved.
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 implied.
12
+# See the License for the specific language governing permissions and
13
+# limitations under the License.
14
+
15
+
16
+from oslo_config import cfg
17
+from oslo_config.fixture import Config
18
+
19
+from os_dpm.config import config
20
+from os_dpm.tests import base
21
+
22
+
23
+class TestNetworkingDpm(base.TestCase):
24
+
25
+    def test_register_opts(self):
26
+        conf = Config()
27
+        conf.load_raw_values(group="dpm", hmc='host')
28
+        conf.load_raw_values(group="dpm", hmc_username='username')
29
+        conf.load_raw_values(group="dpm", hmc_password='password')
30
+        conf.load_raw_values(group="dpm", cpc_uuid='uuid')
31
+
32
+        config.register_opts()
33
+        self.assertEqual('host', cfg.CONF.dpm.hmc)
34
+        self.assertEqual('username', cfg.CONF.dpm.hmc_username)
35
+        self.assertEqual('password', cfg.CONF.dpm.hmc_password)
36
+        self.assertEqual('uuid', cfg.CONF.dpm.cpc_uuid)

+ 1
- 0
test-requirements.txt View File

@@ -7,6 +7,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
7 7
 coverage>=4.0 # Apache-2.0
8 8
 python-subunit>=0.0.18 # Apache-2.0/BSD
9 9
 sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
10
+oslo.config!=3.18.0,>=3.14.0 # Apache-2.0
10 11
 oslosphinx>=4.7.0 # Apache-2.0
11 12
 oslotest>=1.10.0 # Apache-2.0
12 13
 testrepository>=0.0.18 # Apache-2.0/BSD

Loading…
Cancel
Save