diff options
author | 2017-09-16 16:58:18 +0800 | |
---|---|---|
committer | 2017-09-18 14:44:28 +0800 | |
commit | 861bb6490d9ee9ddf79cdfce7fe677381ea9c945 (patch) | |
tree | f9dbfe3350be29694f0eaf70c0f7d2b05be9102c /tests/unit/prepare | |
parent | 8ec26b129c0543896cd65af6dd5d33529f56fd24 (diff) |
Some optimizations about unit test
Remove some "if/else".
Rename a variables and a file.
Split a testcase in two cases.
Change-Id: Ic107845ac8eff41ba20e1501c93925586d6cbde9
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'tests/unit/prepare')
-rw-r--r-- | tests/unit/prepare/test_prepare_execute.py (renamed from tests/unit/prepare/test_prepare_execure.py) | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/unit/prepare/test_prepare_execure.py b/tests/unit/prepare/test_prepare_execute.py index 9e72722d..03259b93 100644 --- a/tests/unit/prepare/test_prepare_execure.py +++ b/tests/unit/prepare/test_prepare_execute.py @@ -21,7 +21,7 @@ deploy.prepare.execute.KOLLA_CONF_PATH = '/tmp' @pytest.fixture(scope="module") -def kolla_conf_file_nov_path(): +def kolla_conf_file_nova_path(): return os.path.join(deploy.prepare.execute.KOLLA_CONF_PATH, 'nova') @@ -44,19 +44,19 @@ def clear_tmp_dir(path): os.rmdir(path) -def test__set_qemu_compute(kolla_conf_file_nov_path): +def test__set_qemu_compute(kolla_conf_file_nova_path): _set_qemu_compute() - exp_conf_file = os.path.join(kolla_conf_file_nov_path, 'nova-compute.conf') + exp_conf_file = os.path.join(kolla_conf_file_nova_path, 'nova-compute.conf') assert os.path.isfile(exp_conf_file) - clear_tmp_dir(kolla_conf_file_nov_path) + clear_tmp_dir(kolla_conf_file_nova_path) -def test__set_default_floating_pool(kolla_conf_file_nov_path, conf_file_dir): +def test__set_default_floating_pool(kolla_conf_file_nova_path, conf_file_dir): network_conf_file = os.path.join(conf_file_dir, 'network_virtual1.yml') _set_default_floating_pool(network_conf_file) - exp_conf_file = os.path.join(kolla_conf_file_nov_path, 'nova-api.conf') + exp_conf_file = os.path.join(kolla_conf_file_nova_path, 'nova-api.conf') assert os.path.isfile(exp_conf_file) - clear_tmp_dir(kolla_conf_file_nov_path) + clear_tmp_dir(kolla_conf_file_nova_path) def test__set_trusts_auth(kolla_conf_file_heat_dir): |